Batch File sub folders

B

Bikini Browser

Hi and Merry Christmas Everyone!

I am trying to write a DOS batch file that will backup my C: Drive to my P:
Drive. and I want to include all the folders in my source directory.

How do you include subfolders to be backed up too? I used to know this, but
it seems that the DOS Command is not valid anymore.

It basiclly looks like this...
@Echo off
net use P: \\Computer-name\PeachTree
c:
cd\
cd "Documents and settings\UserName\my documents"
copy *.* P:

Long ago, I think I used to use a "/s" switch, but that does not seem to
work anymore.

Any ideas on how to do this more effectively?

Bikini Browser
San Juan Puerto Rico
Where the babes are tan all year long!
 
L

Lanwench [MVP - Exchange]

Bikini Browser said:
Hi and Merry Christmas Everyone!


I am trying to write a DOS batch file that will backup my C: Drive to
my P: Drive. and I want to include all the folders in my source
directory.
How do you include subfolders to be backed up too? I used to know
this, but it seems that the DOS Command is not valid anymore.

It basiclly looks like this...
@Echo off
net use P: \\Computer-name\PeachTree
c:
cd\
cd "Documents and settings\UserName\my documents"
copy *.* P:

Long ago, I think I used to use a "/s" switch, but that does not seem
to work anymore.

Any ideas on how to do this more effectively?

Use robocopy from the resource kit - no need to map a drive, either.

----
robocopy "c:\documents and settings\username\my documents"\
"\\computername\sharename\folder name"\ /e /r:1 /w:1
----

Robocopy /??? will give you all the available parameters.
Bikini Browser
San Juan Puerto Rico
Where the babes are tan all year long!

Aren't young children supposed to wear sunblock?
 
P

Pegasus \(MVP\)

Bikini Browser said:
Hi and Merry Christmas Everyone!

I am trying to write a DOS batch file that will backup my C: Drive to my
P: Drive. and I want to include all the folders in my source directory.

How do you include subfolders to be backed up too? I used to know this,
but it seems that the DOS Command is not valid anymore.

It basiclly looks like this...
@Echo off
net use P: \\Computer-name\PeachTree
c:
cd\
cd "Documents and settings\UserName\my documents"
copy *.* P:

Long ago, I think I used to use a "/s" switch, but that does not seem to
work anymore.

"copy" never had the "/s" switch but "xcopy.exe" does. However,
robocopy /s would be a more reliable option, as suggested by Lanwench.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top