| Login

Search this Blog


Links I like to keep around


Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Jul3

Written by:R Teachout
7/3/2008 8:49 AM 

Hate the vbs scripts that output results, and when you run them from wscript, you have to click 'OK' a few hundred times?  Ensure it is running from cscript with this little bit of code.

Here's a snippet of code that I use at the top of vbs files to ensure they are only run from a command line, because I hate having to click 'OK' hundreds of times.


if lcase(right(Wscript.FullName, 11)) <> "cscript.exe" then
    wscript.echo "*****************************************************************" & VbCrLf & _
       "How to use this:  'cscript " & Wscript.ScriptName & " ARGUMENT" & VbCrLf & _
       "*****************************************************************"
   wscript.quit 0
end if

Tags:

In an open world, who needs Windows or Gates
-Unknown

Inspired by Nina