iNNOKENTIY21
Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Код: 'Windows-1251 Sub FileExists(file) If (NOT fso.FileExists(file)) Then WScript.Echo file, " - не найден." Call EndScript() End If End Sub Sub EndScript If (NOT IsNull(fso)) Then Set fso = Nothing End If If (NOT IsNull(objShell)) Then Set objShell = Nothing End If WScript.Quit End Sub Dim fso Set fso = CreateObject("Scripting.FileSystemObject") Set scriptFullName = fso.GetFile(Wscript.ScriptFullName) scriptPath = fso.GetParentFolderName(scriptFullName) Dim file file = scriptPath & "\Get-DefaultBrowser.ps1" Call FileExists(file) prog = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" args = " -nologo -noninteractive -file " comd = prog & args & """" & file & """" Set shell = CreateObject("WScript.Shell") shell.Run comd, 0, false |
|