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 want to run CMD-file, as described here.

I set run file every 5 minutes in the task scheduler. But when the scheduler runs the file - the window flashing. How to run CMD-file in background mode?

Installed Windows 7.

share|improve this question

migrated from Oct 1 '12 at 3:57

This question came from our site for professional and enthusiast programmers.

up vote 1 down vote accepted

For full text and alternative methods see

Save this one line of text as "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"

This is just a little dangerous because your batch file MUST be able to close itself and MUST never produce an error which might require user input. Otherwise the batch file will hang invisibly until system shutdown or until someone kills it with the task manager.

share|improve this answer
You should copy in the relevant part. – Ariel Sep 6 '12 at 10:26
Thank you! VBS - this is what I need. – Scott Dev Sep 6 '12 at 10:41

You must log in to answer this question.