Discussion Locked

Copying files from one server to another

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

When I run a scheduled (Norton Program Scheduler) batch file that copies a file from one server to another, I get an Access Denied message. It does not happen when I execute the batch file from the command prompt, only when the batch file is scheduled. The batch file looks like this:

pkzip backup.zip
copy backup.zip \\server1\backup

(backup is a shared folder)

8 replies

by bcross

Sometimes scheduled operations cannot be completed because the user account it may be using does not have the proper permissions. Check account permissions.

by joevano

I would assume that it is a permissions problem. I am not familiar with Norton Scheduler, but the Windows task scheduler allows you to set the user to run the batch as. If Norton's doesn't have that option then there are other ways to get it done inthe batch file itself.

Replace the copy with these lines to see if it works ( the 'net use' continues all the way to the username it wraps in this window):

net use z: \\server1\backup password /USER:domainname\username

copy backup.zip z:netuse z: /delete

You may replace the 'z:' with any drive letter that would be available when the batch file runs. Put the password of the user who has access to the share where it says password, and replace domainname\username with the username of the user whose password you used. For example if the user 'johndoe' belonged to the domain 'FOO' and his password was 'xyz' that section of the command would look like this:

net use z: \\server1\backup xyz /USER:FOO\johndoe

For more help typeon the net use command type 'net use ?' at a command prompt.

by joevano

I forgot to mention, the one issue I have with this method is that the password is clearly visible in the batch file, but if the 'Run as" option isn't available I know of no other way.

by mckaytech

I share your security concern about the clear-text password. The only thing I know to do if you have to use this method is set up a special-purpose user account with only the bare minimum rights needed to accomplish the task and to set hours of access that correspond to the time the task will occur.

One other idea might be to encrypt the file before zipping and shipping it. That might also reduce the security risk somewhat.

paul

This discussion is closed to new replies.