本帖最后由 yhcfsr 于 2019-3-7 18:12 编辑
- <# :
- @echo off&cd/d "%~dp0"
- more +8 "%~f0" >"%temp%\%~n0.ps1"
- powershell -NoLogo -NoProfile -ExecutionPolicy bypass -File "%temp%\%~n0.ps1"
- del /f /q "%temp%\%~n0.ps1"
- pause
- #>
-
- $files = dir *.* -r -Exclude *.bat;
-
- foreach($file in $files)
- {
- $newpath = "$($file.Directory)\"+($file.BaseName -replace '_','\');
- if( !(Test-Path $newpath) ) {[void] (md $newpath);}
- Move-Item -Path $file -Destination $newpath
- }
复制代码
|