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
pbhcpaIT DirectorAsked:
Who is Participating?
 
pbhcpaConnect With a Mentor IT DirectorAuthor Commented:
Nevermind. I found that it is stored as C:\Windows\Tasks\At1.job

I just had to use REN in the batch file.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
There doesn't appear to be:
http://support.microsoft.com/kb/313565
0
 
pbhcpaIT DirectorAuthor Commented:
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.
0
 
Paul MacDonaldDirector, Information SystemsCommented:
Are you sure that will work?  If you rename the job, will Windows be able to find it?
0
 
pbhcpaIT DirectorAuthor Commented:
Yes. Done it on 5 servers without issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.