Link to home
Start Free TrialLog in
Avatar of pbhcpa
pbhcpaFlag for United States of America

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
ASKER CERTIFIED SOLUTION
Avatar of pbhcpa
pbhcpa
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Paul MacDonald
There doesn't appear to be:
http://support.microsoft.com/kb/313565
Avatar of pbhcpa

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.
Are you sure that will work?  If you rename the job, will Windows be able to find it?
Avatar of pbhcpa

ASKER

Yes. Done it on 5 servers without issue.