How to execute a scheduled task with "schtasks" without opening a new command line window ?

Posted by Misha Moroshko on Super User See other posts from Super User or by Misha Moroshko
Published on 2010-10-03T02:27:04Z Indexed on 2011/02/08 15:28 UTC
Read the original article Hit count: 187

Filed under:
|
|

I have a batch file that creates a scheduled task using schtasks like this:

schtasks /create /tn my_task_name 
                 /tr "...\my_path\my_task.bat"
                 /sc daily
                 /st 10:00:00 
                 /s \\my_computer_name 
                 /u my_username    
                 /p my_password

It works OK except the fact that when my_task.bat is executed - a new command line window is opened (and closed after execution).

I would like to avoid opening this new window (i.e. to run the task in quiet mode, in the background).

I thought to use

start /b ...\my_path\my_task.bat

but I don't know how, because since I have to call start from the batch file I need to precede it with cmd /c, which again causes the new window to open.

How could I solve this problem ?

© Super User or respective owner

Related posts about windows-xp

Related posts about batch