Creating VBS with Batch File

May 12, 2010 at 10:12:30
Specs: Windows 7 Ultimate, 4GB DDR2
Hi, I'm trying to create a Windows Script to run a batch file [without that ugly black screen =P] using a Batch File [I know most people do the opposite but w/e] but Command Prompt just won't accept it [except for the last line], I get this message:

"The system cannot find the path specified.
'Chr' is not recognized as an internet or external command, operable program or batch file."

Here's the code of the batch file:

ECHO Set WshShell = CreateObject("WScript.Shell") > vbs.vbs
ECHO WshShell.Run chr(34) & "C:\sandbox\test.bat" & Chr(34), 0 >> vbs.vbs
ECHO Set WshShell = Nothing >> vbs.vbs

See More: Creating VBS with Batch File

Report •

May 12, 2010 at 11:02:00
the ampersands are ampersanding. You'll need to escape
ECHO WshShell.Run chr(34) ^& "C:\sandbox\test.bat" ^& Chr(34), 0 >> vbs.vbs

Report •

May 13, 2010 at 09:01:53
Thanks! I didn't know it was so simple, I'm a total noob at windows scripting >.<!

I wonder if you could also help me with my other batch issue:

And also a probably stupid question:

Report •

Related Solutions

Ask Question