Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $dir = "\\localhost\C$\test\"
- $exeName = "X.exe"
- echo $dir
- echo $exeName
- for($i=0;$i -le 5; $i++)
- {
- $exe = $dir + $exeName
- echo $exe
- $pinfo = New-Object System.Diagnostics.ProcessStartInfo
- $pinfo.WorkingDirectory = $dir
- $pinfo.FileName = $exe
- $pinfo.UseShellExecute = $false
- $p = New-Object System.Diagnostics.Process
- $p.StartInfo = $pinfo
- $p.Start() | Out-Null
- #$p.WaitForExit()
- #$stdout = $p.StandardOutput.ReadToEnd()
- $exeName = "X_" + $i + ".exe"
- rename-item -path $exe -newname $exeName
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement