回复 11# thp2008 - @echo off
- set "reg=[^a-z\d\u4e00-\u9fff.-]"
- REM 改文件名
- PowerShell "dir -Literal '%~dp0' -Recurse | ?{$_ -is [IO.FileInfo] -and $_.Name -match '%reg%'} | forEach{ $newName = $_.Name -replace '%reg%'; mv -Literal $_.FullName -Dest ($_.PSParentPath + '\' + $newName) -Force }"
- REM 改文件夹名
- PowerShell "dir -Literal '%~dp0' -Recurse | ?{$_ -is [IO.DirectoryInfo] -and $_.Name -match '%reg%'} | sort FullName -Desc | forEach{ $newName = $_.Name -replace '%reg%'; mv -Literal $_.FullName -Dest ($_.PSParentPath + '\' + $newName) -Force }"
- pause
复制代码
|