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.

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

3 Answers

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

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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