2008-10-23

Simple Script for Executing an .EXE

I figured I'd add some simple scripts to the collection. This one is almost too simple, but it might help a beginner out there somewhere.

If you just need a quick, no nonsense script to execute a target .exe file you can use the code below:






Option Explicit
Call Main()
WScript.Quit(0)

On Error Resume Next

Sub Main
Dim objShell : Set objShell = CreateObject("Wscript.Shell")

objShell.Run "\\FILE_PATH\FILE.EXE", 0, True

Set objShell = Nothing
End Sub

No comments: