UseWScript...
4
This was an update someone else's snippet...
VBScript is a graceful language and Windows Scripting Host cleans up after itself, so this is a compact version for simple usage - reducing code bloat is what small scripts are for.
Just my $.02...
VBScript is a graceful language and Windows Scripting Host cleans up after itself, so this is a compact version for simple usage - reducing code bloat is what small scripts are for.
Just my $.02...
UseWScript
Sub Main
msgbox "Using " & WScript.Name, 64, "Script Check"
End Sub
Sub UseWScript()
if (instr(LCase(WScript.FullName),"wscript.exe")=0) then
Set objShell = CreateObject("WScript.Shell")
objShell.Run WScript.ScriptFullName
WScript.echo "Using " & Right(WScript.FullName,11) & ", will now close and launch using WScript"
WScript.Quit
else
'Execute Main process only if using WScript
Main
end if
end sub






There are currently no comments for this snippet.