Vbscript: Run a Program

1. Asks Name of the program/command to run
2. Runs that Program.
3. If Program name is not given, then Execution stops.

On Error Resume Next ' Skip Errors
Dim gProg, gWS, gAsk, gStyle, gTitle, gCheck ' Variables Declaration

Set gWS =WScript.CreateObject ("WScript.Shell") ' WScript Object
Do ' Start Looping
gProg = ""
gProg = Inputbox("Enter The Name of The File", "Run", "cmd") ' Get Name of Program from User
If gProg = "" Then WScript.Quit
gWS.Run gProg

No comments:

Post a Comment

Thank you for commenting. Please keep visiting.