how to add scheduled task, or is it possible?
what if i wanted myapp.exe to be launched every monday at 09:00 ?
Archive: how to add scheduled task, or is it possible?
how to add scheduled task, or is it possible?
what if i wanted myapp.exe to be launched every monday at 09:00 ?
A little forum search came up with:
http://forums.winamp.com/showthread....light=schedule
That would be a good plugin for NSIS.
Do you think it will be made?
-Stu
Not by me on the near couple of weeks.
At NT/W2k/Xp system there is command AT.EXE.
at.exe 9:00 /every:monday "c:\test.exe"
Job could be done using updated system plugin (as soon as exehead will be updated too, for plugin look at "Exehead & Ole" thread). I've included source file with function and use example (since it will be hard to extract information from this page :)
Usage:
push "My Task"
push "My Task Comment"
push "c:\Working Dir\My Task Program.exe"
push "c:\Working Dir"
push "My Program Args"
; what that's structure means? look thru attached nsi file, that's information tooks to many place
push "*(&l2, &i2 0, &i2 2003, &i2 9, &i2 3, &i2 0, &i2 0, &i2 0, &i2 9, &i2 0, i 0, i 0, i 0, i 2, &i2 1, &i2 0x2, &i2 0, i 0, &i2 0) i.s"
Call CreateTask
Pop $0
MessageBox MB_OK "CreateTask result: $0"
Realization and TIME_TRIGGER structure description are at attached nsi file.
well, i got first example working fine, but i didn't manage to do it with the other one :(
tnx anyway
first example???? I've posted only one...
Oh. you mean at.exe. :)
To utilize second one (it will work at win95-winxp) you'll need the latest CVS (as soon as Kichik will update it for compatibility with system plugin ;).
So... All together: KICHIK! KICHIK!! KICHIK!!!
well i still didn't understand second example, but i have a question with the first one. By default this command line
'at.exe 9:00 /every:monday "c:\test.exe"'
gives a name for the scheduled task "at1". is it possible to give job different name?
For the second one you need the latest CVS version. As for the name of the task with the first one, if to believe to at.exe /?, you can't.
Somebody checked it beside me? Kichik could you please? ;)
Yes, it works.
ok got it:)
Just a system update.
release 5, 11 september 2003.
1. u flag - unload dll after procedure call.
2. some changes to asm to turn on Whole Program Optimization.
3. Dll shrinked for 1 kb.
Uploaded, thanks.
Before delving deeper into this plug-in, does it use the Task Scheduler API?
If so, does it have the same limitation as XP's command line schtasks?
By limitation I mean the inability to schedule a task with an empty password (in addition to the fact that it's not available in XP Home).
Answering myself:
Originally posted by nsnbYes! It creates the familiar job files in %WINDIR%\Tasks.
does it use the Task Scheduler API?
Originally posted by nsnbYes. If the password for the account is empty, then the task would not start and logs the following error:
If so, does it have the same limitation as XP's command line schtasks?
The attempt to retrieve account information for the specified task failed; therefore, the task did not run. Either an error occurred, or no account information existed for the task.The behavior of the existing "NSIS Scheduled Tasks" in my test system (XP SP2) is frustratingly unexplainable: The above error would occur if the scheduled job is produced by the script, but if the same exact task is opened via GUI and interactively uncheck-then-check the box "Run only if logged on", then the task would start.
The specific error is:
0x8004130f: No account information could be found in the Task Scheduler security database for the task indicated.
Originally posted by nsnbThis problem is driving me crazy. I've combed the web and found many many posts describing a situation similar to what I described. For example:
Any explanation for that? How do I even begin to troubleshoot a problem like this (aside from looking at the log file and reading what I quoted above)?
This is a secretly undocumented feature by Microsoft. You can't schedule tasks on a Windows account with administrator privileges that has no password.
Originally posted by roncaWhat??? This doesn't make sense. If Microsoft wanted to prohibit an Admin account with an empty password, it would have been disabled across the board, not only for the Task Scheduler.
This is a secretly undocumented feature by Microsoft. You can't schedule tasks on a Windows account with administrator privileges that has no password.
Originally posted by nsnbOf course it doesn't make sense but that's Microsoft. You don't have to believe me. I don't know if you discovered this already but in task scheduler you can't enter a path with spaces in it. For example if you have something in "C:\Program Files" you must use C:\Progra~1 instead. Makes sense? Of course not but that's Microsoft.
What??? This doesn't make sense.
Originally posted by roncaIt turns out you were correct.
I don't know if you discovered this already but in task scheduler you can't enter a path with spaces in it. For example if you have something in "C:\Program Files" you must use C:\Progra~1 instead. Makes sense? Of course not but that's Microsoft