Blog Detail

Running a VBscript from batch (command line)

1 Nov , 2016,
arien
, ,
No Comments

Most of the time a specific scripting language is chosen to provide an automated solution for something.
In this case a customer was already using batch scripting. I was adding simple VBscripts to query the WMI Namespaces. Well how to use these different scripts in hybrid and pass values back to the original batch startup script?

The VBS being used in this example is checking WMI for the Write Filter State (used in the Windows Embedded OS).
Microsoft is using the commands available to check and manage the filter and splitting the huge output to find the current state of the writefilter here. In my opinion it is better to use the information available in WMI:

The cscript //nologo is the most important part of the command you use to start the .VBS!
When we compare the output without the nologo switch we see these differences:
cscript-nologo

Now to call the and get it’s result and put it in a variable

BTW, Very usefull when creating WMI code is the WMI Code Generator created by Rob van der Woude.

Leave A Comment