| Login

Search this Blog

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:

Spending an evening on the World Wide Web is much like sitting down to a dinner of Cheetos, two hours later your fingers are yellow and you're no longer hungry, but you haven't been nourished.
-Clifford Stoll

Inspired by Nina