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 command problem

Status
Not open for further replies.

otherc

MIS
Oct 30, 2000
6
0
0
US
Hi, i have a problem with the windows nt 4.0 at command. I want to copy a directory from a map network drive to a local sever, but it doesn't work i try to test the following commands:

at 23:00 "cmd /c xcopy H:\remote\*.* c:\mybackup /E"

at 23:00 "xcopy H:\remote\*.* c:\mybackup /E"

at 23:00 cmd /c xcopy H:\remote\*.* c:\mybackup /E

even a delete command works!

what can i do if i need to copy at this time that files or subdirectories?

Can you help me?



Thank you!


 
Try it with c:\mybackup\ instead of c:\mybackup. Also, for copying whole directories and everything under them, have you tried a little program called robocopy? It's a nice robust command line copy program. Let me know if you want me to email it to you.
 
Of course you can, thank you for your response.
 
When using WinAT it's important to remember that the user context it runs in is the same as the one that runs the service.

If you are trying to copy to another server (as it looks) you need to make sure that the user profile on that machine has the drive mapped correctly and has permissions on the target volume.

In an instance like this you MUST have WinAT using a user login rather then system credentials.
 
Well maybe i miss some points. I made a bat file with the same instructions, and it works, with the same user. The permissions are rights, and in a bat file works. But with the at command nothing happens. What i just want to know is if i can do that with the at command.
 
I dont know if you still having problems or not. but in my explorations making a server automatically reboot using at i have found that the one that comes on the nt resource cd does not like to do stuff from root (aka c:\shutdown) it decides to add gibberish to the end of the command before executing it. i have found that moving it to c:\winnt\shutdown did result in it working fine. also if you install internet explorer 5.0 you get a nice little folder in my computer called scheduled tasks and this version of at actually seems to work alot better. let me know if ya need any further help.

Karl Pietri
LAN Technician
Northview Public Schools

"The trouble with the rat race is that even if you win, you're still a rat."
- Lily Tomlin

Karl Pietri
lordhuh.pota.to

 
LBussey is partially right: The account running the scheduler service does have to have appropriate privileges (share permissions & ACLs) on the target server (assuming PDC & same/trusted domains; you can do it w/o but that adds another layer of headaches). The user logged in to the console (if any) is irrelevant (scheduled job will run even if console is at login screen as long as scheduler service is running).

The real problem is that scheduled jobs can not use logical drive names (ex: F:) for network shares. You have to use UNCs and usually an explicit NET USE before performing any operations to/from it.

For testing/diagnostic purposes you can also get a scheduled job to display a shell on the console as it executes so any errors can be observed as they happen.

This is all documented in the NT online docs (Start > Help > Index (tab) > at command > Display).

I had this same problem with a client when I was still in consulting and it took me forever to get it to work. I might still have some sample code if you still need it after reading the online doc.
 
i would really appreciate your help. I am some worried because i need to do that and simply doesn't work.
 
Otherc, what the others are trying to tell you is to go into the Control Panel>Services, choose the scheduler service and change it to log on under a domain ID that has the proper permissions instead of the default system account. If you do not do this, any scheduled jobs can only operate on the local machine and cannot access network resources at all.

Jeff
masterracker@hotmail.com

If everything seems to be going well: you don't have enough information.......
 
Hi, I tried to change the account that the schedule service starts with, and it is greyed out. How do you change it?
 
I had At problems it seemd AT cant handle multiple commands in the command line and also dosnt see the path enviroment for the initials prog you run.
eg
at 23:00 "c:\cmd /c xcopy H:\remote\*.* c:\mybackup /E"

or create a batch file with "c:\cmd /c xcopy H:\remote\*.* c:\mybackup /E" in it then
at 23:00 "c\:batchfilename.bat"

this work for me the key was not to rely on the path enviroment as AT cant see it.

Richard Baker
RFBaker@BTInternet.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top