Windows XP or later Windows: How can I run a batch file in the background with no window displayed?

Here is a possible solution: From your first script, call your second script with the following line: wscript.exe invis.vbs run.bat %* Actually, you are calling a vbs script with: the [path]\name of your script all the other arguments needed by your script (%*) Then, invis.vbs will call your script with the Windows Script Host Run() … Read more

Escape double quotes in parameter

Another way to escape quotes (though probably not preferable), which I’ve found used in certain places is to use multiple double-quotes. For the purpose of making other people’s code legible, I’ll explain. Here’s a set of basic rules: When not wrapped in double-quoted groups, spaces separate parameters:program param1 param2 param 3 will pass four parameters … Read more

Redirecting Output from within Batch file

The simple naive way that is slow because it opens and positions the file pointer to End-Of-File multiple times. @echo off command1 >output.txt command2 >>output.txt … commandN >>output.txt A better way – easier to write, and faster because the file is opened and positioned only once. @echo off >output.txt ( command1 command2 … commandN ) … Read more