0

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
1
  • Thanks everyone for the helps. Turns out there's an easier solution if all we need is to pass parameters to an EXE. May 23, 2011 at 13:56

2 Answers 2

2

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"

0

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

}

Not the answer you're looking for? Browse other questions tagged .