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()

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: