- <#*,:&cls
- @echo off
- pushd "%~dp0"
- powershell -NoProfile -ExecutionPolicy RemoteSigned -Command ". ([ScriptBlock]::Create((Get-Content -LiteralPath \"%~0\" -ReadCount 0 | Out-String ))) "
- popd
- pause
- exit /b
- #>
- $txt = "list.txt"
- $bbb = "bbb.exe"
- $aaa = "aaa.bat"
-
- $arr1 = Get-Content -Path $txt -ReadCount 0
- $goto3 = $arr1[0] + ".exe"
- foreach ($item in Convert-Path -Path ".\$($arr1[0])\*\*\$bbb") {
- Rename-Item -Path $item -NewName $goto3 -Force
- }
- $arr2 = Get-Content -Path $aaa -ReadCount 0
- $arr2 -replace 'XXX\.exe', $goto3 | Set-Content -Path $aaa
复制代码
|