Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question

migrated from stackoverflow.com May 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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
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
add comment

2 Answers 2

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

}

share|improve this answer
add comment

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"

share|improve this answer
add comment

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