# Batch file with DOS box hidden? [duplicate]

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

-

## migrated from stackoverflow.comMay 25 '11 at 3:28

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

## marked as duplicate by Sathya♦May 25 '11 at 11:02

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

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"

-

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();


}

-