pbhcpa
asked on
Name A Scheduled Task From The Command Line or Batch File
I have a batch file that I run on several servers to schedule a task:
at 12:00 /Every:F C:\clean_n_defrag.bat
The name of the task ends up being At1 (or At2, At3, etc depending on the names of existing jobs)
Using the above AT command, is there a way for me to establish the name of the task as it is created?
If not, is there something I can run next that will rename and existing task? (In this case, renaming At1 to something like "Weekly Cleanup and Defrag)
Thanks
at 12:00 /Every:F C:\clean_n_defrag.bat
The name of the task ends up being At1 (or At2, At3, etc depending on the names of existing jobs)
Using the above AT command, is there a way for me to establish the name of the task as it is created?
If not, is there something I can run next that will rename and existing task? (In this case, renaming At1 to something like "Weekly Cleanup and Defrag)
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yeah I read that article. Ended up just using this:
at 12:00 /Every:F C:\clean_n_defrag.bat
ren c:\windows\tasks\At1.job "Cleanup and Defrag.job"
This gave me the results I needed. Thanks for posting the article link though. It will help someone down the road.
at 12:00 /Every:F C:\clean_n_defrag.bat
ren c:\windows\tasks\At1.job "Cleanup and Defrag.job"
This gave me the results I needed. Thanks for posting the article link though. It will help someone down the road.
Are you sure that will work? If you rename the job, will Windows be able to find it?
ASKER
Yes. Done it on 5 servers without issue.
http://support.microsoft.com/kb/313565