sara2000
asked on
bat file in task scheduler.
I am trying to run simple bat file in windows task scheduler and it is not running.
This is what I did in the action box
Pointed to c:\myfile\test.bat, but this file runs when I double click on desktop.
This is what I did in the action box
Pointed to c:\myfile\test.bat, but this file runs when I double click on desktop.
ASKER
it has admin user right.
Ok
Then action is start a program
In program/script write only test.bat
And in optional start in write c:\myfile\
Then action is start a program
In program/script write only test.bat
And in optional start in write c:\myfile\
how did you add it to task manager? through the GUI or from command line?
if from the GUI then the user that you created under must be logged in.
set it from the command line. (then it runs with administrative permission, no matter who is logged in or even if noone is logged in.)
cmd prompt with elevated privileges
c:\> at 22:00 /every:m,t,w,th,f c:\myfile\test.bat
here's a link for the command line formatting of the at command:
http://support.microsoft.com/kb/313565
if from the GUI then the user that you created under must be logged in.
set it from the command line. (then it runs with administrative permission, no matter who is logged in or even if noone is logged in.)
cmd prompt with elevated privileges
c:\> at 22:00 /every:m,t,w,th,f c:\myfile\test.bat
here's a link for the command line formatting of the at command:
http://support.microsoft.com/kb/313565
Sara, what makes you think it does not run?
Task Scheduler does not run programs interactively unless we set it up to "only run when the user is logged on" - if we don't select that, it will run, but invisible.
Could you make sure it does not run invisible?
Task Scheduler does not run programs interactively unless we set it up to "only run when the user is logged on" - if we don't select that, it will run, but invisible.
Could you make sure it does not run invisible?
ASKER
McKnife:
Here is my simple bat file for snapdrive schedule. if the schedule runs then there should be an snapshot, I do not see the snapshot.
I know that comand runs when I am in comand prompt .
@echo off
sdcli snap create -s %computername%_%date:~4,2% _%date:~7, 2%_%date:~ 12,2%_%tim e:~0,2%
Here is my simple bat file for snapdrive schedule. if the schedule runs then there should be an snapshot, I do not see the snapshot.
I know that comand runs when I am in comand prompt .
@echo off
sdcli snap create -s %computername%_%date:~4,2%
You shoud use quota "%computername%_%date:~4,2 %_%date:~7 ,2%_%date: ~12,2%_%ti me:~0"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
1. Something bad in transer to cmd. There usualy help when you change extention from bat tu cmd
2. You are trying to do something withou coresponding user rights. Try to setu user with runing script admin no systemaccount.
3. Setup arguments in sheduler and work directory c:/myfile/
<competing site link removed - GaryC13>