level 2
不清楚你的实际文件/情况,仅以问题中的说明及猜测为据;以下代码复制粘贴到记事本,另存为xx.bat,编码选ANSI,跟要处理的文件和文件夹放一起双击运行
<# :
cls&echo off&mode con lines=3000
rem 将一个指定文件拷贝/复制到同一目录下的多个文件夹里
set #=Any question&set _=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%_% %z%
cd /d "%~dp0"
powershell -NoProfile -ExecutionPolicy bypass "[IO.File]::ReadAllText('%~f0',[Text.Encoding]::GetEncoding('GB2312'))|Invoke-Expression"
echo;%#% +%$%%$%/%_% %z%
pause
exit
#>
$files=@("b文件.txt");
[byte[]]$b=@(32,45,45,62,32);
$c=[Text.Encoding]::Default.GetString($b);
$folders=@(dir|?{$_ -is [System.IO.DirectoryInfo]});
for($i=0;$i -lt $files.length;$i++){
if(test-path -liter $files[$i]){
for($j=0;$j -lt $folders.length;$j++){$files[$i]+$c+$folders[$j];}
}else{write-host ($files[$i]+' 未找到') -ForegroundColor yellow;}
}
2021年09月18日 12点09分