Batch file to copy folder

December 18, 2008 at 07:51:41
Specs: xp, Core2Duo T7300 2Ghz, 1GB

Hello,

I'm new to batch scripts.

I'm trying to copy a local folder to a folder on a remote PC.

Is there an easy way to do this with a script?


See More: Batch file to copy folder

Report •


#1
December 18, 2008 at 08:09:27

If the remote is mapped:

copy c:\src x:\dest


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
December 18, 2008 at 08:20:42

Unfortunately, the remote is not mapped. Can this be included in the script as well?

Report •

#3
December 18, 2008 at 08:28:39

I'm pretty sure it can but I don't have a network. Wait for one of the other guys to jump in.


=====================================
If at first you don't succeed, you're about average.

M2


Report •

Related Solutions

#4
December 18, 2008 at 09:53:17

cpro,

net use * \\remote_computer\sharename
-maps to first available drive letter.

net use x: \\remote_computer\sharename
- This will map to x: .
But then if then if x: is already mapped,
it will ask a question wheter to override the existing mapping.

If you want to avoid that interactive question, you can call "net use x: /d" prior to mapping a new location.

In Summary, you have to put these commands in a filename.bat file and execute them:
net use x: /d
net use x: \\remote_computer\sharename
copy source\location\files* x:\desitnation\location

change the specifics to suite ur needs.

--
Holla.


Report •

#5
December 18, 2008 at 12:53:12

excellent.

thanks for the help with this!


Report •

#6
December 19, 2008 at 10:40:18

you could also use the default admin share to copy the files.

copy C:\Folder \\compName\C$\Folder


Report •


Ask Question