Hopefully "ScriptingTipsAndTricks" helps you with your batch file or vbscript scripting :-)
[Bottom][Contents][Prev]: WMIC.exe - WMI From Windows Command Line (batch files)[Next]: CommaSeperatedHexString() - Dump string as hex values seperated by commas
\->VBSCRIPT Files

VBSCRIPT Files

VBSCRIPT files should normally be run via the Windows "cscript.exe" interpreter. You would normally include at least the "//NoLogo" switch.

For a good introduction to VBSCRIPT have a look at "http://www.tutorialspoint.com/vbscript/".

Compared to batch files VBSCRIPT has a much higher "native" ability to do things but you will probably still need to make external calls to Windows commands and often also other useful programs.

If you double click on a VBSCRIPT file in "explorer" then it will be opened up in "wscript.exe" which is normally useless for command line work and each "ECHO" command will result in a popup which gets annoying fast.

Because of multiple Windows design flaws you can't simply execute vbscript like any other executable, you will need to:

  1. Supply the full path to the vbscript file.
  2. Supply the the file extension
  3. Specify the interpreter "cscript.exe" as the command being executed.

You can work around this by defining your own vbscript file extension and registering this to Windows. This would allow you to execute these scripts like any other command, no need to provide the extension and the "PATH" would be searched.

$todo: VBSCRIPT stuff...

Example code & Fragments

Please see these fragments and examples:


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: WMIC.exe - WMI From Windows Command Line (batch files)[Next]: CommaSeperatedHexString() - Dump string as hex values seperated by commas


ScriptingTipsAndTricks© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Sunday September 07 2014 at 12:50pm
Visit ScriptingTipsAndTricks's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.