bkbkbk
bkbkbk

Reputation: 838

how to hide cmd shell window?

on start up i have a bat file run routine things for me

however, the black console pops up and stays open until everything is finished....

anyway to hide it and run it in background ? so it shouldn't appear minimized or system tray.

Upvotes: 5

Views: 24287

Answers (6)

Vivin Paliath
Vivin Paliath

Reputation: 95518

Try renaming your file to .cmd instead of .bat.

Or, if you're executing a .exe try:

start "" "C:\Program Files\SomeProg\someprog.exe"

Note: When using "start" you have to be at a command prompt.

Upvotes: 0

insign
insign

Reputation: 5783

This link should help you as helped me. I used the second solution that uses a program named quiet.exe

To use, just call quiet.exe program params_if_has.

My use example: quiet.exe php script.php

Upvotes: 2

Craig
Craig

Reputation: 51

You can use a VBS script to achieve this. Either write all your code as VBS, or call your batch file like this:

'launch.vbs
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "mybatch.bat", 0
WshShell = Null

Upvotes: 5

Joey
Joey

Reputation: 354506

I once had a little program which could hide windows based on their title. So my startup batch first set a unique title with title and then called the other program to hide the window with said title. Worked fine but involves a little programming.

If you don't want to go that way, then you should use the Task Scheduler as tr4656 noted.

Upvotes: 0

jamieb
jamieb

Reputation: 10033

Create a shortcut to the file. On the new shortcut: Right click -> Properties. Go to the Shortcut tab, and choose "Run: Minimized." (This is assuming you're on WinXP).

Upvotes: 2

tr4656
tr4656

Reputation: 1298

You can't really do that but if you are using the scheduler to run the batch file you can select "don't interact with desktop" when creating the job.

Upvotes: 0

Related Questions