Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to start a console app upon startup, but I'd like it not to clutter the taskbar with a cmd.exe item. The options I have when editing a shortcut are only "Normal window", "Minimized", and "Maximized". I faintly remember some Windows version having "Hidden" as an option. I'm using Windows 2008.

share|improve this question
up vote 2 down vote accepted

I've had this problem too, I wrote a small app that does this: http://miffthefox.googlepages.com/silentcmd.

share|improve this answer
    
I used your solution. Nice little utility. – JCCyC Aug 26 '09 at 22:22

You can create a .vbs file with the following

Const HIDDEN_WINDOW = 12

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")

Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = HIDDEN_WINDOW
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create("Cmd.exe /c C:\run.bat", null, objConfig, intProcessID)

And replace

"Cmd.exe /c C:\run.bat"
with your silent command

share|improve this answer
1  
Wow, that is a lot of work for what the WScript.Shell object already exposes with it's .Run method. – EBGreen Aug 25 '09 at 21:09
    
Didn't work. It starts and ends, doesn't print any message when I run it from a command prompt. What I'm trying to run is the Folding@Home client, fah6.exe. I don't want to run it as a service. – JCCyC Aug 26 '09 at 22:00

According to this page from the MSDN setting intWindowStyle (one of the arguments to WScript.Shell.Run) to 0

Hides the window and activates another window.

Though it also states:

intWindowStyle
Optional. Integer value indicating the appearance of the program's window. Note that not all programs make use of this information.

share|improve this answer

You must log in to answer this question.

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