I\'m using CScript to run a VBScript file, and I need to pass a command line to the script where the parameter includes both spaces and quotes. The entire command needs to
You have two options.
The first is easy enough--escape the quotes using the carat (^).
C:\> CScript myscript.vbs //Nologo "cmd.exe /c ^"dir && del /q *.txt^""
The second option is to use a different delimiter. In a command like this, the shell uses a space as a delimeter between parameters. But the shell allows others like semicolons, commas, equal signs, and tabs. By implementing one of these, you wouldn't need to surround parameters with quotes because spaces would no longer break your command line.