mynab
9th March 2005 13:09 UTC
Scheduled tasks
Hello,
I am trying to setup scheduled tasks and properly set the user /password that I get through a custom page. I use a script that I got somewhere (can't remember exactly but probably here) that uses ITaskScheduler and ITask. I therefore does something like:
System::Call '$R2->30(w "user", w "password")'
but it does not seem to work. Does anyone has any success with this?
Thanks,
mynab
Afrow UK
9th March 2005 16:05 UTC
Please search the forum in future...
http://forums.winamp.com/showthread....highlight=task
-Stu
mynab
10th March 2005 17:03 UTC
Please read the messages in the future...
The thread you mention is the one I got the script from. I am trying to enhance this script to add a call to ITask to set the user and password on the task I create. Anyone?
-Mynab
Afrow UK
10th March 2005 18:10 UTC
Sorry but your original post did not contain information about the direct source.
Try t instead of w
-Stu
kichik
10th March 2005 18:23 UTC
According to MSDN, SetAccountInformation requires Unicode string, so w is ok.
What's the return value of the method?
mynab
11th March 2005 08:21 UTC
Not sure if it's right but what I did is add i.R9 at the end of my System::Call line and then do a MessageBox with $R9 and it displays 0 which is equal to S_OK. So it seems Windows does not complain.
However if I then go to the scheduled tasks panel and run my task it fails. If I open the task set the password and then run it again it is OK so I guess I really have to set the password on the task even though the task should be run by the same user as the one that installs the software (Administrator in that case).
mynab
mynab
16th March 2005 15:34 UTC
Anyone on this?
mynab
kichik
17th March 2005 20:50 UTC
Can you post the complete code snippet so it can be tested?
mynab
31st March 2005 15:38 UTC
Sorry kichik,
did not see your post and switched to something else. Just tought I should give an update on this.
I finally discovered and started to use the schtasks command. Much more powerful than the at command as it allows for everything I needed except multiple scheduling for the same task. It might not be available on older systems but it is at least on XP Pro and 2003 Server. Just type schtasks /? at the command prompt to get a detailed explanation of all the command line switches.
Regards,
mynab