Run a VBScript file

To run a VBScript from within another VBScript:

Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "cscript c:\batch\demo.vbs"

Run a CMD batch file

To run a CMD batch file from VBScript:
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "c:\batch\test.cmd"

Run a PowerShell script

To run a PowerShell script from VBScript:
Dim objShell
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run "powershell -file ""c:\batch\demo.ps1"""

Related

Run a script from PowerShell
Run a script from the CMD shell

“Those that set in motion the forces of evil cannot always control them afterwards” ~ Charles W. Chesnutt


© Copyright SS64.com 1999-2014
Some rights reserved