Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AT scheduling

Status
Not open for further replies.

Hondy

Technical User
Mar 3, 2003
864
0
0
GB
Anyone know how to schedule a shortcut (.lnk) rather than a .bat? Or how to change the working directory of a batch file (not a shortcut)

The problem I'm getting is that when I schedule the shortcut it uses the target file not the shortcut itself and therefore loses the working directory. So I need to know how to set the working directory of a batch file or how I can schedule a shortcut and retain the working directory.

Thanks
 
lets say that batch starts in c:\windows\system32 directory. If you want to change directory in a batch or even chenge to another drive letter simply;

echo Changing to Z drive
z:
echo Changing to BlahBlah directory located inside of Bob directory
cd BOB\BlahBlah

HTH - Stiddy
 
thanks, i wanted to change the working directory rather than the directory. I have done a work around instead as I don't think it's possible to do what I was trying to do.

Thanks for replying anyway
 
how about something simple like adding the path location to the path statement in the environment variables section of the PC that you're running the shortcut from ??

-SWarrior
 
If you use the Task Scheduler (GUI) instead of AT then you can set the starting (working) direcotry. You can also set more advanced scheduling options than what is available to AT. The ".job" file created by the GUI can also be copied to other machines rather than manually created each time. Additionally though you must supply user credentials to run the task instead of allowing it to run under the scheduler account as with AT.

I don't know if you are stuck using AT instead of the Task Scheduler for some reason but that would be the way to do it. Post more details if there is still a problem and we will see what else we can suggest.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top