Originally Windows NT 4.0 included an old version of the Schedule service, also known as At service (Atsvc.exe). Internet Explorer 5.01 upgrades it to the new version of the Schedule service, Task Scheduler (MSTask.exe) and converts At jobs to Scheduled Tasks. So: before you go any further, figure out what version you have. If you have the current version, just attempt to make one of your "favorites" available offline and it will download and install the "Offline Browseing Pack" which will add a "Tasks" folder under the windows directory.
With the old At service, all At jobs had to run in the same account as the service itself. The default account for the AT service was the Local System account, but it could be changed to another user account if desired. Some Windows NT 4.0 users changed the At service's account because they needed their jobs to run in a user account.
With the Task Scheduler, each scheduled task can be configured to run in a different account. The Task Scheduler service itself has to run in the Local System account, but each scheduled task can be configured to run in a different account.
Note: For backward compatibility, the Task Scheduler allows the user to set one account to use when running scheduled tasks that were created from At jobs. When Internet Explorer 5.01 is installed, this account is set to the Local System account. If you are running Windows NT 4.0 and you changed the account that the At service ran in to something other than the Local System account, then after installing Internet Explorer 5.0 you would need to manually re-enter the user name and password for that account. To do this, in the Tasks folder, click the Advanced menu, and then click AT Service Account.
Now the really tricky part: If you use the AT command to schedual a task, it runs it as the user set in the AT Service Account dialog, but if you have that set to the System account and you open that task in the Tasks folder, it will show the Run As setting as your current user even though it isn't going to run as that user. If you press the Set Password... button and enter the password for your user, then it will run as that user.
Next, the user that you set must have the following permissions turned on:
And the admin is the only user that does not have these 2 rights as standard! I believe this is for security. Set up a new user with only those rights.
In the Scheduled Tasks folder, on the Advanced menu, there is a View Log option which opens the %system%\SchedLog.Txt file. In this file, each job and its result is listed. The order is earlier to later, but the "end of file" wraps around to keep the file at 32k or less so the latest jobs are not necessarily at the actual end of file. Search for 5 stars (*****) to find them.
If you are upgraded to the Task scheduler service, and try to use the AT
command to enter a job with special characters, (e.g. > or | ) quote marks
will only cause the job to not be found. Use the ^ character before each
special character instead. e.g.
at 16:18 c:\batch\test.bat ^> c:\batch\error.log
Don't assume that directing the output of a batch to a log file will allow you to see the error messages... it will not capture anything sent to stderr! Only what goes to stdout will be seen.
Another way to debug things, assuming AT Service Account is set to the System
account, is to schedual cmd.exe /K with the interactive option on
to start one minute from now. E.g.
at 16:18 /INTERACTIVE cmd.exe /K (Take care not to forget the interactive!)
After a short (always seems long) wait, a command prompt will appear. Then you can run your job and see all the errors or whatever. Note that echo %username% will return %username% because you are running as the System account which is not a user.
However, the System account can not use unc paths (e.g. \\server\share), and jobs with a local user can not be interactive. As per Q158825
In order to run an interactive application by using the AT command, the application needs to be started with the local system account, and the "Allow service to interact with desktop" check box must be checked. If the Schedule service is set to log on as the local system, scheduled jobs cannot be validated on the network. If you start the schedule service with a user account, jobs can be validated on the network, but they cannot have any user interface, because only the local system has sufficient privileges to allow a service to start a program on the interactive desktop. Unless 16-bit applications have access to the interactive desktop, they most likely not start as they run under Ntvdm. Therefore, you can have network access or interactivity with the system (needed by Ntvdm), but not both.
NOTE: This is by design, for security purposes. You do not want a regular user to be able to schedule a job that would run when the administrator is logged on, and use the administrator's credentials.
Batch jobs start in the system32 folder so make sure your paths are correct.
|file: /Techref/os/win/winnt/cron.htm, 5KB, , updated: 2004/6/2 18:08, local time: 2016/7/1 08:27,
|©2016 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/os/win/winnt/cron.htm"> Windows NT Task Scheduler / AT service</A>
|Did you find what you needed?|
PICList 2016 contributors:
o List host: MIT, Site host massmind.org, Top posters @20160701 RussellMc, Neil, IVP, James Cameron, Bob Blick, Richard Pope, alan.b.pearce, Denny Esterline, John Gardner, Jean-Paul Louis,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!