I know it sounds strange, but my idea is creating a single text file which contains a VBScript and a Batch Script within it, i.e. if I run that script as a VBScript, it calls itself as a Batch script, and that batch script do some cmd.exe tasks.
I know you can use the .ShellExecute method and then run multiple commads using CMD /C [...], but this is a little difficult to read.
My try was:
If False Then
goto batchLines
End If
[...VBScript continues here...]
Wscript.Quit
:batchLines
[...batch Script starts here...]
But as spected, it does not worked at all.
cmd /c stror build up some string str that'd make up a batch script, write it to a temp bat file, then do shell execute cmd /c batchscript. It's not what you ask for exactly, but it's just another way of getting the batch and the vbscript – barlop Jul 08 '15 at 22:06//E:VBSoption. – dbenham Jul 09 '15 at 04:09