batch file to copy across computers

February 25, 2009 at 23:10:39
Specs: Windows XP
Hi,

I need to create a batch file on my computer that will copy a file from:

\\virtus\dbbackups\tpos_Wednesday.gbk

and then paste it here:

\\172.25.0.71\c$ (this one needs a username and password)

Is this possible?

Thanks in advance!! :)


See More: batch file to copy across computers

Report •


#1
February 26, 2009 at 00:38:33
The following script maps a drive to both machines using x and z.
First checks for a connection and if found removes, maps the drive - if there is a password needed a prompt will ask for a username and password for the machine to connect with, the script will copy the file then remove the mapped drive.

If you need to automate the username and password use:

net use x: \\172.25.0.71\c$ /user:domainorcomputername\username password | theuserpassword

Here is the script:

@echo off
if exist x: (net use x: /delete)
if exist z: (net use z: /delete)
net use x: \\172.25.0.71\c$
net use z: \\virtus\dbbackups\
copy z:\tpos_Wednesday.gbk x:\
if exist x: (net use x: /delete)
if exist z: (net use z: /delete)

For help with the commands type:

net use /? 
at the command prompt.

Good luck.


Report •

#2
February 26, 2009 at 06:01:58
Thanks :) This solves my problem!

Report •

Related Solutions


Ask Question