不清楚你的实际文件/情况,仅以问题中的样例/说明为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI
/*
echo off&cls
rem 根据一个指定目录下指定扩展名/后缀名文件所在的目录结构,在另一个指定目录里创建相同的目录结构
mode con lines=3000
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "oldfolder=D:\xxx\E文件夹"
set "newfolder=D:\xxx\E文件夹 - 副本"
if not exist "%oldfolder%" (echo;"%oldfolder%" not found&pause&exit)
if "%oldfolder:~-1%" equ "\" set "oldfolder=%oldfolder:~,-1%"
if "%newfolder:~-1%" equ "\" set "newfolder=%newfolder:~,-1%"
for /f "tokens=1* delims=|" %%a in ('dir /a-d-h/b/s "%oldfolder%\*.wav"^|cscript -nologo -e:jscript "%~f0" "%oldfolder%" "%newfolder%"') do (
if not exist "%%~dpb" (
md "%%~dpb"
echo;"%%~dpb"
)
)
echo;%#% +%$%%$%/%_% %z%
pause
exit
*/
var oldfd=WSH.Arguments(0),newfd=WSH.Arguments(1);
while(!WSH.StdIn.AtEndOfStream){
var it=WSH.StdIn.ReadLine();
WSH.echo(it+'|'+newfd+it.substring(oldfd.length));
}
/*
echo off&cls
rem 根据一个指定目录下指定扩展名/后缀名文件所在的目录结构,在另一个指定目录里创建相同的目录结构
mode con lines=3000
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
set "oldfolder=D:\xxx\E文件夹"
set "newfolder=D:\xxx\E文件夹 - 副本"
if not exist "%oldfolder%" (echo;"%oldfolder%" not found&pause&exit)
if "%oldfolder:~-1%" equ "\" set "oldfolder=%oldfolder:~,-1%"
if "%newfolder:~-1%" equ "\" set "newfolder=%newfolder:~,-1%"
for /f "tokens=1* delims=|" %%a in ('dir /a-d-h/b/s "%oldfolder%\*.wav"^|cscript -nologo -e:jscript "%~f0" "%oldfolder%" "%newfolder%"') do (
if not exist "%%~dpb" (
md "%%~dpb"
echo;"%%~dpb"
)
)
echo;%#% +%$%%$%/%_% %z%
pause
exit
*/
var oldfd=WSH.Arguments(0),newfd=WSH.Arguments(1);
while(!WSH.StdIn.AtEndOfStream){
var it=WSH.StdIn.ReadLine();
WSH.echo(it+'|'+newfd+it.substring(oldfd.length));
}