Sometimes in my batch scripts I usually merge batch code with JavaScript code (.js file), like this:
@if(@X)==(@Y) @end /* ← Hybrid line. Starts a Javascript comment block.
::Batch code
@echo off
set code=65
cscript //nologo /E:JScript "%~f0" %code% ← Calls itself using cscript.exe.
pause>nul
exit/b
*/ ← Ends the comment block, now we can write JavaSCript.
//JavaScript code
WScript.echo(String.fromCharCode(WScript.Arguments.Unnamed(0)));
Its output is A
(65 ASCII).
Ok, JavaSCript works fine. My question is: How do I do that with VBScript
? I am not an expert in VBScript, but I know there's not any way to make comment blocks in my code, hence I can't use the same technique as I used with JavaScript.
Supposing I have a code that does the same thing (converts ASCII code passed on first parameter to a char), but now in VBScript:
WScript.echo chr(WScript.Arguments.Unnamed(0))
How can I merge this VBScript code with my batch code as I did with JavaScript?