task scheduler opens command prompt window

  • Thread starter Thread starter Dale
  • Start date Start date
D

Dale

I have a dos command set to run in Task Scheduler, the COPY command. Every
time Task Scheduler runs the task the Command Prompt Window opens on my
desktop for a second. It is annoying, how can I prevent it. I would like it
to just run in the background.
Dale
 
Dale said:
I have a dos command set to run in Task Scheduler, the COPY command. Every
time Task Scheduler runs the task the Command Prompt Window opens on my
desktop for a second. It is annoying, how can I prevent it. I would like it
to just run in the background.
Dale

A search on Google suggests that the Command Prompt supports a command line
switch to start the subsequent Command prompt minimized.

cmd /min

is the basic syntax.

Look here for more info - and don't forget Google!

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/start.mspx

Martin.
 
OK, how do I get it to run at scheduled times? I wrote the "main.bat" file
and it runs oK in the command prompt. Do I just paste the lines below, that
you directed me to, into the Task Scheduler command line??

Set WshShell = CreateObject("WScript.Shell")

cmds=WshShell.RUN("c:\main.bat", 0, True)

Set WshShell = Nothing

Dale
 
Thanks
would the command line in Task scheduler be as below to copy a file without
the command prompt window opening?
I Tried it this way but it didn't work

cmd /min copy C:\path\filname C:\path\

Dale
 
Copy those 3 lines to a Notepad, and save as "cmds.vbs" in a folder. Open
Scheduled Tasks, and schedule cmd.vbs to run at specified time.
 
OK, I tried it. Every time it runs I get an error message from Microsoft
Scripting Host even though I am sure I have the correct file path in Task
scheduler

Script: C:\Program Files\Willing Webcam\cmds.vbs
Line: 2
Character: 1
Error: The system cannot find the specified file.
Code: 80070002
Sourrce: (null)

my cmds.vbs reads

Set WshShell = CreateObject("WScript.Shell")
cmds=WshShell.RUN("C:\Program Files\Willing Webcam\upload.bat", 0, True)
Set WshShell = Nothing

I am trying to get the cmds.vbs to run the upload.bat file which runs fine
from a command prompt.

Thanks, Dale
 
I found a way to do it.
I created a shortcut on my desktop to the upload.bat file with "run
minimzed" option checked. This creates a .lnk file in my \Documents and
Settings\Me\Desktop\ directory which I enter in Task Scheduler so Task
Scheduler runs the .lnk file

Dale
 
You may use this script to prevent the "file not found" error:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top