I just need to write a simple batch file just to run a vbscript. Both the vbscript and the batch file are in the same folder and is in the SysWOW64 directory as the vbscript can only be execute in that directory. Currently my batch file is as follows:
@echo off
%WINDIR%\SysWOW64\cmd.exe
cscript necdaily.vbs
But the vbscript wasn't executed and just the command prompt is open. Can anyone tell me how can i execute the vbscript when i run this batch file?
Batch files are processed row by row and terminate whenever you call an executable directly.
- To make the batch file wait for the process to terminate and continue, put
call
in front of it.- To make the batch file continue without waiting, put
start ""
in front of it.I recommend using this single line script to accomplish your goal:
(because this is a single line, you can use @ instead of @echo off)
If you believe your script can only be called from the SysWOW64 versions of cmd.exe, you might try:
If you need the window to remain, you can replace /c with /k