1.

Solve : bat/vbs files?

Answer»

I was wondering how to MAKE a bat file run a vbs file. CALL it using the appropriate scripting engine, either CSCRIPT.exe or wscript.exe, using the //nologo SWITCH (unless you really want to see a message from Microsoft)
If the visual basic engine is already installed on your PC, and it should be for any version of MS Windows, then just call the .vbs script from the batch file:

@Echo off
cls
call sample.vbs
Rem Continue batch file


It should work.



Quote from: TheShadow on May 18, 2011, 07:02:27 PM

If the visual basic engine is already installed on your PC, and it should be for any version of MS Windows, then just call the .vbs script from the batch file:

There are two Visual Basic script engines usually installed in Windows, Wscript.exe and Cscript.exe. Your approach works, but it does not give control over which engine is chosen, you just get the current default (Wscript on a new install but it COULD have been changed to Cscript) and furthermore you are at the mercy of the current script engine settings such as Logo / Nologo. Of course this may not matter.

Code: [Select]@ start "Path\to\yourfile.vbs"
start cmd.exe and write: Code: [Select]start /? for more info


Discussion

No Comment Found