I learned this command from a colleague at my present job and over the past two weeks have learned to LOVE it. The “AT Command” which schedules a task on either local or remote PC’s. I only use it on XP PC’s so I’m not sure if it’s available on other OS’s like Vista, Windows 7 or legacy OS’s.
There’s also another command which Microsoft says is “more powerful” – schtasks. This command replaces the “at” command and is probably more relevant to the newer OS’s like Vista and Windows 7.
In the end I think the syntax is similar so using either is your choice!
If you want to schedule a command locally use a command like this:
at 00:00 “\\yourserver\yourshare\batchfile.bat”
This simply schedules the task “at” midnight on your local computer calling “batchfile.bat”, within “batchfile.bat” you can have your script which does something. Maybe it installs software, deletes files, sets security permissions, etc, etc? Possibilities are a plenty!
Here are some more examples of an at job:
:: Schedules a job at midnight on a remote PC
at \\networkcomputer 00:00 “\\yourserver\yourshare\batchfile.bat”
:: Schedules a job next tuesday on a remote PC
at \\networkcomputer 00:00 /next:Tuesday “\\yourserver\yourshare\batchfile.bat”
:: View a scheduled task on a remote computer
:: Delete a scheduled task on a remote computer, job number 1, if it’s job 15 you’d replace the 1 with 15
at \\networkcomputer 1 /delete
at \\network computer 15 /delete
:: Schedule a job at midnight every Tuesday
at \\networkcomputer 00:00 /every:Tuesday “\\yourserver\yourshare\batchfile.bat”
:: Here’s a for loop to schedule a job on a list of PC’s at 11 PM:
for /f %i in (c:\pclist.txt) do at \\%i 23:00 “\\yourserver\yourshare\batchfile.bat”
:: Here’s a for loop to delete the scheduled job on a list of PC’s at 10 PM just in case you want to delete the job!
for /f %i in (c:\pclist.txt) do at \\%i 1 /delete
I hope this helps anyone looking for AT command help!
this is very helpful for scheduled task. thanks for the tip!