Possible Duplicate:
Run a completly hidden batch file

On XP(SP3), is there a way to run a batch file without the DOS box being displayed at all (not just minimized)?

I tried several things, including "EXIT /B", "GOTO:EOF", and Erik Heijnen's ConsoleTool, to no avail.

Thank you.


Edit: Here's a simple solution when we just need to pass parameters: Add a Shortcut to the Deskop, and modify its Target parameter to pass parameters:

"C:\Program Files\Acme\MyApp\MyApp.exe" /MYSWITCH 123
link|improve this question

60% accept rate
Thanks everyone for the helps. Turns out there's an easier solution if all we need is to pass parameters to an EXE. – OverTheRainbow May 23 '11 at 13:56
feedback

migrated from stackoverflow.com May 25 '11 at 3:28

This question came from our site for professional and enthusiast programmers.

closed as exact duplicate by Sathya May 25 '11 at 11:02

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

This question has been asked over on SuperUser, and has a lot of good answers:


The top answer is:

Save this one line of text as file invisible.vbs:

CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False

To run any program or batch file invisibly, use it like this:

wscript.exe "C:\Wherever\invisible.vbs" "C:\Some Other Place\MyBatchFile.bat"

link|improve this answer
feedback

convert batch process as service.

Create a new C# Windows application and call this method from main:

public static void RunBatchFile(string filename) { Process process = new Process();

process.StartInfo.FileName = filename;

// suppress output (command window still gets created)
process.StartInfo.Arguments = "> NULL";

process.Start();
process.WaitForExit();

}

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.