Batch File to transer files from one server to another

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

I've been asked to create a batch file that will copy the contents of one
folder that sits on one server to another folder that sits on another server.
This has to be done every night around 9pm.

I've never created a batch file before but so far I've found how to copy the
contents of a folder to another folder on the same machine:

@echo on
xcopy c:\TestSource c:\TestDestination /m /e /y

how would I modify this to copy files to a folder that sits on another server

thanks in advance.
 
airwalker said:
I've been asked to create a batch file that will copy the contents
of one folder that sits on one server to another folder that sits
on another server. This has to be done every night around 9pm.

I've never created a batch file before but so far I've found how to
copy the contents of a folder to another folder on the same machine:

@echo on
xcopy c:\TestSource c:\TestDestination /m /e /y

how would I modify this to copy files to a folder that sits on
another server

Change the destination to be the share on the server... and make sure that
the permissions on the share in question are such that the credentials the
batch script run under via a scheduled task can write to said share...
 
It is best to use UNC names rather than drives. The drives may not always be
mapped.

xcopy \\server1\source\*.* \\server2\source /m /e /y
 
Thank you all for responding, your posts were very helpful. Just one more
thing tho, the file copying is now done by a small application written in
visual studio 2005. What I need to do now is write a batch file that opens
visual studio 2005 and executes the application.

how do you open visual studio 2005 and run an application stored in it from
a batch file?

thanks in advance
 
I would like to use xcopy to copy a folder with subfolders and enclosed
files, most of which are encrypted by the XP limited user, with the
destination a usb drive sometimes connected to the laptop.

so far my batch file generates a "file not found" error. Can that message
be generated by a permission problem? (or have I somehow miscoded the
path/name)?

There is an xcopy parameter that causes XCOPY to unencrypt the source file.
how and why does this work (if it works) on source files encrypted by a
limited XP user account when the batch file is executed by another user(even
administrator)? Wouldn't that be a pretty obvious security loophole?
 
Back
Top