vbscript - Running Powershell from vbs with command as parameter -
Hey, I want to escape from a PowerShell commando with a VBS script. Enter some more specific commands like powershell.exe such as resume-service. I thought that something like this could work:
strCommand = "C: \ Windows \ system32 \ WindowsPowerShell \ v1.0 \ powershell.exe- command restart service [service name ] Set "Set WshShell = WScript.CreateObject (" WScript.Shell ") objExec = WshShell.Exec (strCommand) Does anyone know how I can manage this?
1) Store your powerhouse command as PowerShell Script.
2) Use vbs to run the powers
set audobject - object ("Wscript.Shell") objShell.Run ("powershell.exe -noexit c: \ scripts Test.ps1 ")
Comments
Post a Comment