Цитата pogo:
Что совсем никаких идей нет, как можно с ps скрипт переписать? »
|
Есть другая идея -- запускать PowerShell без создания окна из VBS-файла:
Код:

CreateObject("WScript.Shell").Run "powershell ""$OtherCleanPathsArr = 'C:\Temp\*', 'C:\Windows\Temp\*', 'C:\swsetup'; $InProfilesCleanPathsArr = '\AppData\Local\Temp\*', '\AppData\Local\*.auc', '\AppData\Local\Microsoft\Terminal Server Client\Cache\*', '\AppData\Local\Microsoft\Windows\Temporary Internet Files\*', '\AppData\Local\Microsoft\Windows\WER\ReportQueue\*', '\AppData\Local\Microsoft\Windows\Explorer\*'; $Profiles = Get-ChildItem (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList').ProfilesDirectory -Exclude 'Администратор', 'admin', 'Administrator', 'Setup', 'Public', 'All Users', 'Default User'; ForEach ($Path in $OtherCleanPathsArr) {Remove-Item -Path $Path -Recurse -Force -ErrorAction SilentlyContinue}; ForEach ($Profile in $Profiles) {ForEach ($Path in $InProfilesCleanPathsArr) {Remove-Item -Path $Profile$Path -Recurse -Force -ErrorAction SilentlyContinue}}""", 0
.