Batch File sub folders

  • Thread starter Thread starter Bikini Browser
  • Start date Start date
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!
 
net use /? will show all options.

Frank

"Bikini Browser" <delete.bikini.this.browser@gmail.com> wrote in message
news:uW4lHU$PIHA.4276@TK2MSFTNGP06.phx.gbl...
> 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!
>
 
Bikini Browser <delete.bikini.this.browser@gmail.com> 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?
 
"Bikini Browser" <delete.bikini.this.browser@gmail.com> wrote in message
news:uW4lHU$PIHA.4276@TK2MSFTNGP06.phx.gbl...
> 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.
 
Back
Top