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 added a batch file to the Windows 7 scheduler and it works fine. The problem is it always displays a command prompt window when it is run. I created a shortcut for the batch file and set it to run minimized in properties.

Then I went to the scheduled task and tried to change the action to run the shortcut instead of the original batch file. The problem is the scheduler resolves the shortcut immediately and puts the original batch file path to the action field. What should I do?

share|improve this question
up vote 5 down vote accepted

You need to tell the batch file to run without a console.

This page has some instructions for writing a Windows Script:

Set Shell = CreateObject("WScript.Shell")
Shell.Run <Path to command or batch file>, 0, False

It also mentions a tool called hstart - which I haven't seen before, so you'd need to check it out.

This question on Stack Overflow has some other suggestions as well as full instructions for writing a vb script to wrap the code I posted above.

share|improve this answer
+1 - works a treat. – Kez Feb 15 '10 at 15:24
Reference to run command: – Brettski Aug 29 '10 at 6:54
Plus it seems the run method has problems with folder names with spaces – Brettski Aug 29 '10 at 7:06

You must log in to answer this question.

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