This following example is created by user Michael Dillon from this answer.
Consider the following script:
This script snippet does:
cscriptcommand which calls itself with all the arguments provided.
As the part after
@set @junk=1is commented(
*/Are valid JScript comment),
JScript will ignore them.
Note: We need the
@set @junk=1part because the batch file does not recognize
/*as a command, but a
setstatement will be a workaround. JScript will recognize
/*as a comment so the other
batchfile will not be executed by JScript engine.
You can add your JScript after
*/ and start extending your batch file scripting!