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

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -