我想要遍历一个文件夹及其所有子文件夹,保留当前文件的一个计数器变量,并将其重命名为$counter$ExistingFileName。
例如。
$count = 1;
foreach $file in $folder
{
$file.name = $count + $file.name;
$count++;
}能回答这个问题的人将是我的英雄!:)
顺便说一句,我使用的是Windows 7。
发布于 2011-04-30 18:10:55
SETLOCAL ENABLEDELAYEDEXPANSION
set count=1
for /r .\folder %%f IN (*.*) do (
ren "%%f" "!count!%%~nf%%~xf"
set /a count=!count!+1)https://stackoverflow.com/questions/5840450
复制相似问题