PC Review


Reply
Thread Tools Rate Thread

Batch File sub folders

 
 
Bikini Browser
Guest
Posts: n/a
 
      16th Dec 2007
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!


 
Reply With Quote
 
 
 
 
FrankV
Guest
Posts: n/a
 
      16th Dec 2007
net use /? will show all options.

Frank

"Bikini Browser" <(E-Mail Removed)> wrote in message
news:uW4lHU$(E-Mail Removed)...
> 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!
>



 
Reply With Quote
 
Lanwench [MVP - Exchange]
Guest
Posts: n/a
 
      16th Dec 2007
Bikini Browser <(E-Mail Removed)> wrote:
> 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?



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      16th Dec 2007

"Bikini Browser" <(E-Mail Removed)> wrote in message
news:uW4lHU$(E-Mail Removed)...
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wild cards for folders in Win 7 batch file Dibbler Windows XP General 0 21st Jun 2011 04:06 PM
Save batch window msgs to a file from the batch prog Stephen Rainey Windows XP General 3 10th Jan 2007 12:50 AM
Batch file to delete files/folders? Brian Wescombe Windows XP Help 1 1st Oct 2006 11:59 PM
Command Line / Batch File set permissions for folders / files Alex Windows XP Security 1 11th Sep 2004 12:24 AM
Automate answer to a "System Prompt" ? ( Batch File clean up folders ) Angela Windows XP Performance 2 9th Mar 2004 04:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:20 PM.