Hi, I want to run powershell command from vbs script. Something like start powershell.exe and enter a specific command, for example Restart-Service. I thought something like this might work:
strCommand = "C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -command Restart-Service [service name]" Set WshShell = WScript.CreateObject("WScript.Shell") Set objExec = WshShell.Exec(strCommand)
Does anyone have an idea how I can do this?
source share