Computing.Net > Forums > Programming > Batch file to copy folder

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file to copy folder

Reply to Message Icon

Name: cpro2002
Date: December 18, 2008 at 07:51:41 Pacific
OS: xp
CPU/Ram: Core2Duo T7300 2Ghz, 1GB
Product: Lenovo thinkpad / T61
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: December 18, 2008 at 08:09:27 Pacific
Reply:

If the remote is mapped:

copy c:\src x:\dest


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

M2


0

Response Number 2
Name: cpro2002
Date: December 18, 2008 at 08:20:42 Pacific
Reply:

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


0

Response Number 3
Name: Mechanix2Go
Date: December 18, 2008 at 08:28:39 Pacific
Reply:

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


0

Response Number 4
Name: Holla
Date: December 18, 2008 at 09:53:17 Pacific
Reply:

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.


0

Response Number 5
Name: cpro2002
Date: December 18, 2008 at 12:53:12 Pacific
Reply:

excellent.

thanks for the help with this!


0

Related Posts

See More



Response Number 6
Name: AJ (by William Jimenez)
Date: December 19, 2008 at 10:40:18 Pacific
Reply:

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

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


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file to copy folder

Batch Job to Copy folders www.computing.net/answers/programming/batch-job-to-copy-folders-/18383.html

Batch file to copy from network dri www.computing.net/answers/programming/batch-file-to-copy-from-network-dri/14488.html

batch file to copy and move certain www.computing.net/answers/programming/batch-file-to-copy-and-move-certain/11052.html