Anyone know how, or even if its possible to add a sheduled task using AMS??
Professional Software Development Tools
Anyone know how, or even if its possible to add a sheduled task using AMS??
ask Scheduler options are stored in the registry in this location:
here is example Create a daily task to run at 11 pm:Code:HKLM\SOFTWARE\Microsoft\SchedulingAgent\
and you can check help just typingCode:SCHTASKS /Create /SC weekly /D MON,TUE,WED,THU,FRI /TN MyDailyBackup /ST 23:00:00 /TR c:\backup.cmd /RU MyDomain\MyLogin /RP MyPassword
all this is from command prompt but you can add it in ams you know your self how to do this.Code:SCHTASKS/?
if I type SCHTASKS/? into the command prompt I get
"SCHTASKS is not recognised as an internal or external command, operable program or batch file"
You need to put a space before the /
schtasks /?
Yossi
Desrat if you want i can give you example in ams to run some software on particular date time and day.
![]()
that would be cool thx
example to if you need any further help i can do this for you.![]()
I just dont think SCHTASKS works for me, I changed the code to this to test it
File.Run("SCHTASKS", "/Create /SC weekly /D FRI /TN desrat /ST 12:47:00 /TR c:\xfcgsg.exe", "", SW_MINIMIZE, false);
and it doesnt even add the task (checking from C:\Windows\Tasks folder)
Ive read and re-read all the info on microsoft regarding SCHTASKS and none of it works for me, however the "at" method works but is useless in my case because the task runs hidden even when using the /interactive flag.
I'm completely clueless as to what to do next....I have noticed that SCHTASKS is available on my Server2003 machine so is it an XP home limitation?
EDIT. schtasks can be found in the windows\system32 dir on my server03 machine, but is not there on XP home...
Last edited by Desrat; 05-04-2007 at 06:05 AM.
you might have to quote your code like this and add another backslash for the one backslash to be recognized.
File.Run("SCHTASKS", "\"/Create /SC weekly /D FRI /TN desrat /ST 12:47:00 /TR c:\\xfcgsg.exe\"", "", SW_MINIMIZE, false);
Tigg
TJ-Tigger
"A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
"Draco dormiens nunquam titillandus."
Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine
thanks Tigg but the schtasks.exe doesnt even exist on my PC so I'm calling a non existant file anyway...
sorry Desrat,
you are right one xp home there is no SCHTASKS command if i m not wrong you can use AT command and as far as my knowledge you can include SCHTASKS in your ams docs folder and run it from there and SCHTASKS can be found on Resource Kit (you can download it from ms web site for free). but if AT do for you or you can include both AT and SCHTASKS and before running any of them add script to check os and then run appropriate command.
TJ_Tigger you dont have to ad any extra \ or /.
Last edited by wasim21k; 05-04-2007 at 09:10 AM.
ok well I put the schtasks.exe in my project and after some fiddling got a workable result, with one major drawback. If there is no password set for the current user account the task will not start. My idea was to get my app to do an auto update at the users discression and now im just gonna force an update check on preload, its much less complicated![]()
first of all Sorry for my English I am French and I use a translator
Personally I use command AT with a XP Pro the command schtasks does not work for me. Here is an example
for 1 execution
For week executionCode:File.Run("at", "05:22 c:\\test.exe", "", SW_SHOWNORMAL, false);
Visit For more instructionCode:File.Run("at", "05:22 /every:M,T,W,Th,F,S,Su c:\\test.exe", "", SW_SHOWNORMAL, false);
http://www.microsoft.com/resources/d....mspx?mfr=true
You should be able to add the parameter /RU SYSTEM which will force the task to run as the SYSTEM account without a password.
You can always create the job manually (using the SYSTEM account) & then just copy the *.JOB files into C:\WINDOWS\TASKS. However it is random whether the job retains its RUN AS option as I have found out in the past so better to use the first option.
As you have worked out, Windows Home by default, does not normally allow you to add Scheduled Tasks via a command line. Bit like the fact NTBACKUP is not installed by default but can be from the CD.
Assume you have checked out: http://support.microsoft.com/default.aspx/kb/814596/
Rgds John