General discussion


scheduling jobs with 'at' command on NT

By nazir ·
I am struggling to schedule two job on windows NT, patch 5 with at command. I am managing to schedule but jobs can't run at all. Is there any tip, or am I applying the format wrong? Here is the command to shut down the database and startup every dayexcept sunday
1. Command one:
at 23:00 /every:M,T,W,Th,F,S cmd /c "c:\bat\pts_shut.cmd > c:\bat\shut.dat"

2. Command two:
at 06:00 /every:M,T,W,Th,F,S cmd /c "c:\bat\pts_start.cmd > c:\bat\start.dat"

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

scheduling jobs with 'at' command on NT

by Astute In reply to scheduling jobs with 'at' ...

AT is a running Schedule service. To start it, type 'net start schedule' on the command line or use Control Panel/Services (if you want to use it regularly, set the Startup Type to Automatic). A common problem is that people try to use the example given in the online help: AT sometime CMD /C DIR > TEST.OUT.

Unfortunately, in NT 4.0, this does not work anymore. You must use AT sometime CMD /C \"DIR > TEST.OUT\" instead.

Note: You must now include an escaped quote before the command and after the file name you are redirecting the output to.

The execution of the command starts by default in %systemroot%\system32, as can be seen from the output of the above example. You should specify the complete path if the command is in a different directory, e.g. AT sometime C:\TEMP\TEST.BAT. A further problem is that the command is executed in the security context of the LOCAL SYSTEM account, not the caller. However, the SYSTEM account does not have access to network resources, so your program cannot reside or access files on mapped drives (even if they are mapped from the local machine!). Also, environment variables (e.g. PATH) may be set differently. You can test the environment interactively with AT sometime /INTERACTIVE CMD.

The AT command in NT runs under the SYSTEM account and therefore has no privileges to the network resources. (i.e. Can't write or read a file from the network). But if you go into Control Panel - Services - Scheduler and change the "Log On As" to a user that has the appropriate permissions (a user with access to the network), then an AT command that runs can actually use the network. This may be useful if you find submitted jobs are failing at certain network operations.

Hope this helps...
Good luck

Collapse -

scheduling jobs with 'at' command on NT

by nazir In reply to scheduling jobs with 'at' ...

Thanx for your help. Yes,
I reschedule the job with my account and the job run.

thanx again.


Collapse -

scheduling jobs with 'at' command on NT

by nazir In reply to scheduling jobs with 'at' ...

This question was closed by the author

Related Discussions

Related Forums