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

1 Answer 1

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: msdn.microsoft.com/en-us/library/d5fk67ky%28VS.85%29.aspx –  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

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.