?
Solved

How do I backup from network drive( mapped) using batch file

Posted on 2006-05-10
6
Medium Priority
?
278 Views
Last Modified: 2010-07-27
I created a a batch file to backup my document to a thumb drive, which works fine.
@echo off
echo Backing up My Documents files
pause
CD c:\Documents and Settings
CD user name
CD My Documents
xCOPY *.* e:\backup /e /y
CD\
echo Backup Complete
pause

But when I move my document on a network & map it on my local drive & do necessary chages in the path in batch file it gives error. Is there any other command which is to be used for networked drive?
0
Comment
Question by:asify
6 Comments
 
LVL 20

Expert Comment

by:Daniel Van Der Werken
ID: 16653882
Try this:

cd /d "c:\Documents and Settings"
cd "user name"
cd "my documents"
xcopy /e /y *.* e:\backup
cd \
0
 

Author Comment

by:asify
ID: 16654142
It didn't work.
0
 

Expert Comment

by:Ibmg
ID: 16654797
Could you post your "modified" batch file and the error?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 2

Expert Comment

by:akumanova
ID: 16655156
You should use the following command to manage network drive:

' REM Map drive Y as local
net use Y: \\MyComputerName\MyDrive

' Write your own codes here e.g. cd "Y:\Documents and Setting" etc...

' REM Remove your mapping drive Y
net use /d Y:

0
 
LVL 20

Accepted Solution

by:
Daniel Van Der Werken earned 1000 total points
ID: 16658067
Well, I assumed e: was already mapped.  If not:

net use e: \\computername\share

if the drive letter is in the path name (for example, c:\my documents versus \my documents), then you need the cd /d command line option instead of just cd.

What's your error?
0
 

Author Comment

by:asify
ID: 16669676
Dan7el
 CD /d command worked. Thanks a lot. It was a great help!!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Six Sigma Control Plans
Loops Section Overview

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question