Solved

I need to copy Complete folders in MS-DOS

Posted on 2001-07-11
14
234 Views
Last Modified: 2007-12-19
I need to copy my favourites from C:\windows\favori~1\ to D:\ drive, but when i write: copy C:\windows\favori~1\ d:\ only the files and not the folders in that favori~1 folder are beeing copied. How can I copy the whole thing with the subfolders and the files in the subfolders? (I can't do it from Windows anymore since it has crashed totally!!!!)
0
Comment
Question by:Ruddi
  • 4
  • 3
  • 2
  • +5
14 Comments
 
LVL 30

Expert Comment

by:SteveGTR
ID: 6272983
Can you use xcopy? If you can, then use the /E parameter to copy directories and subdirectories, including empty ones.

Good Luck,
Steve
0
 
LVL 7

Expert Comment

by:rin1010
ID: 6273624

Ruddi,

You mentioned that you "can't do it from Windows..." You're doing this in DOS mode?
Note that you'll lose the long file names when copying these files in DOS mode.
But the files will remain intact and can still be restored. Also, I'd recommend
creating a separate folder to hold it all and not scatter it around the root of D:
which might be hard to sort later.

You can use the XCOPY command to copy all the files and subdirectories
in the Favorites folder. Presuming you make a folder named FAVORITE on the D: drive
to hold it all, you can use the syntax like:

XCOPY /S C:\WINDOWS\Favori~1\*.* D:\FAVORITE

Type XCOPY/? to get its switches and parameters... If XCOPY doesn't launch,
make sure you have XCOPY.EXE and XCOPY32.MOD on the disk you're booting with
and indicate the path. This presumes you're booting into DOS 7.x (Windows 9.x ver.)
and not a lesser version... i.e., with DOS 6.xx you wouldn't need the MOD file.

Another note; depending on how you boot, you may not have the XCOPY option
to copy Hidden and System files... If you're not getting all the files, first use
the ATTRIB command (attrib.exe) to remove the Hidden, System and ReadOnly attributes
from all the files in the Favorites folder and its subdirectories. You can do it like:

ATTRIB -R -S -H C:\Favor`~1\*.* /S

Once you've copied all the files you can compare the two directories like:

DIR/S/A D:\Favori~1

Also, XCOPY may have problems if it encounters a strange filename,
which can sometimes be created it the Favorites folder.
Please post back if you have problems with this or any other questions about it.
 
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 6273746
You might also want to use pkzip, which I believe would then require (Been awhile) "pkzip C:\C:\WINDOWS\Favori~1 -Pr d:\", though you better double check the -Pr switch.
0
 
LVL 7

Expert Comment

by:rin1010
ID: 6273808

Noticed an error in my ATTRIB example, Ruddi... Thought it was a spec of dirt (lol)
and also didn't type the correct path. To remove the mentioned attributes
from the folder you specified, the syntax should be:

ATTRIB -R -S -H C:\Windows\Favori~1\*.* /S

And while I'm on it; if you're copying files from various locations on your C: drive,
like for backup purposes before reinstalling Windows, then consider using ATTRIB
to remove the attributes from the entire drive so you can see and work with all the files.
You can do it like:

ATTRIB -R -S -H C:\*.* /S

The process may take a few minutes, depending on number of files...
Loading SmartDrv will speed things up... Otherwise just wait a bit...
It may appear nothing is happening during the modifications,
but drive activity should indicate that it's working.
 
0
 
LVL 3

Expert Comment

by:FlamingSword
ID: 6279052
I used to be satisfied with /s switch for subdirectories.
To take advantage of free compression I'll ditto Yoda on pkZip. It is so handy a tool for situations like this it should be among the first toys to go into your toolbox.

I ditto switches as well as memory (lack). Just beware of specifics of upper case vs lower case, it is case sensitive.

My contribution will go - whichever way you go, first do a CD to the directory for top of tree. I reason that if you later decide to change operating system, that the location of "favorites" is likely to also change, so find simple way of letting your backup address that. Also, run the program off a trusted diskette after hard boot using a trusted boot diskette. With a trashed Windows, be on your good behavior as far as safety goes.
0
 
LVL 3

Expert Comment

by:FlamingSword
ID: 6279054
I used to be satisfied with /s switch for subdirectories.
To take advantage of free compression I'll ditto Yoda on pkZip. It is so handy a tool for situations like this it should be among the first toys to go into your toolbox.

I ditto switches as well as memory (lack). Just beware of specifics of upper case vs lower case, it is case sensitive.

My contribution will go - whichever way you go, first do a CD to the directory for top of tree. I reason that if you later decide to change operating system, that the location of "favorites" is likely to also change, so find simple way of letting your backup address that. Also, run the program off a trusted diskette after hard boot using a trusted boot diskette. With a trashed Windows, be on your good behavior as far as safety goes.
0
 

Expert Comment

by:p0ng0
ID: 6282643
Hmmmmm

Hi Ruddi

I think you need to use the following command from the command line:

XCOPY32 C:\WINDOWS\FAVORI~1\. D:\ /E /H /K

I disagree with rin1010, in certain cases it would be okay to unATTRIB all files on the hard drive, but this also unATTRIBs system files in the root folder.  Risky if ever you do an inadvertant DELete (or anyone else for that matter).

In fact, there is no need to use the ATTRIB command at all.  Even System and Hidden files can be copied with the '/H' switch.

The '/K' switch retains the attributes of xCOPYed files.

The following batch file will do the job for you.  Just type FAV2D and bob's you uncle! Call it FAV2D.BAT

@XCOPY32 C:\WINDOWS\FAVORI~1\. D:\ /E /H /K

(Copy and paste this single line into a text file named FAV2D.BAT (or whatever you like) and invoke it from the command line by entering FAV2D).

Oh, and by the way, you DO NOT lose the long filenames as rin1010 suggests!

What more can you ask for?

(for christ sakes man! he asked a simple question.  give him a simle answer!)


0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 7

Accepted Solution

by:
rin1010 earned 50 total points
ID: 6282892

p0ng0,

Just to clarify for you p0ng0, my comments pertain to booting in DOS mode.
Perhaps you've never done this, but it's not the same as running commands
from a 'dos box' under Windows.

In the condition of booting to DOS mode you won't have use of the XCOPY32 /H switch.
Also, long filenames won't be preserved. I highly recommend that you research this
before advising otherwise.

To test it yourself; In Windows, create two folders named Folder1 and Folder2 ...
In Folder1 place three files with long filenames and three files having the Hidden attribute set.
Boot to DOS mode and use XCOPY to copy the files from Folder1 to Folder2 ...
Start Windows and see what you've copied.

As indicated, my suggestion to clear the Hidden and System attributes
presumes that Windows has "crashed totally" as Ruddi mentions,
and files are being copied prior to reinstalling. In this case Windows
Setup will set the appropriate attributes as necessary.

Regarding your reference to clearing attributes of "system files in the root folder"...
I suppose for Windows this alludes to IO.SYS, MSDOS.SYS and COMMAND.COM
and again, if Windows won't launch, they'd conceivably be restored from a boot disk and
certainly during installation. As you can see, my suggestion was offered for consideration
merely to facilitate working with files while copying and archiving for
"backup purposes before reinstalling Windows"...

So if you can't get into Windows and/or you're working in DOS mode,
your /H /K switches won't work... And beware that certain DOS mode procedures such as
copying, moving and renaming files will remove a file's long file name attributes.
 
Hope this defines it better for you... If not, carefully read what is asked
and the remaining discussion. You might agree that what you term a "simple question"
can nevertheless require caveats.
 
0
 
LVL 24

Expert Comment

by:SunBow
ID: 6303951
done?
0
 

Expert Comment

by:ComTech
ID: 6382703
It's time to clean up this topic area and that means taking care of this question. Your options at this
point are:

1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on
the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.

2. PAQ the question because the information might be useful to others, but was not useful to you. To
use this option, you must state why the question is no longer useful to you, and the experts need to
let me know if they feel that you're being unfair.

3.  Ask Community Support to help split points between participating experts.  Just comment here with
details.

4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you
must state why the question is no longer useful to you, and the experts need to let me know if they
feel that you're being unfair.

If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.
 We also request that you review any other open questions you might have and update/close them.  Display
all your question history from your Member Profile to view details.

PLEASE DO NOT AWARD THE POINTS TO ME.

____________________________________________



Hi Experts:

In the event that the Asker does not respond, I would very much appreciate your opinions as to which
Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest
that I PAQ or delete the question.

Experts, please do not add further "answer" information to this question.  I will be back in about one
week to finalize this question.

Thank you everyone.

ComTech
Community Support Moderator @ Experts Exchange
0
 
LVL 10

Expert Comment

by:Longbow
ID: 6391630
Hi ComTech,

I think the aim of the question is not well explained.
More solutions may be found.
This question is one month old now.
Or sharing the points between the better answers.

What is PAQ ?

Longbow

0
 

Expert Comment

by:ComTech
ID: 6392847
Hi Longbow, a PAQ is "Previously Asked Questions", when a question is answered by a user, or is PAQ'd by a moderator, that is because there may be merit or usefull information that will move to our search Data Base.  

A PAQ'd question if there is good information may be accepted by a Moderator if he/she thinks it may help somone in the future. It also removes it from the Active Questions Listing in the Topic Area.  

Before I cleaned up the Hardware TA there were 3,000 open questions, it took two months on that one.

Be here for you guys/gals if you need anything, I can always be reached in the Community Support Area, or email me at comtech@experts-exchange.com

Thanks,
ComTech
Community Support
0
 
LVL 7

Expert Comment

by:rin1010
ID: 6395227

Hi Longbow... You say, "I think the aim of the question is not well explained."
The questioner wants to copy some files and folders using the COPY command,
which doesn't copy folders (or subdirectories)... The question is clear
and has been answered, including excellent information on working with
and getting all of the specific files being copied and other useful suggestions.
This thread also includes comments i took time to provide in hopes of clearing up
potentially detrimental misstatements made by a user so that factual info
is included in the database.

You said, "More solutions may be found." Please provide whatever input you have
or suggestions to moderator ComTech as to options for resolving the question.
Hopefully Ruddi is receiving email notifications and the information here
has accomplished the desired results.
Otherwise I defer to ComTech's opinion on the matter.
 
0
 

Expert Comment

by:ComTech
ID: 6395399
I have read and re-read all comments VERY carefully at least 3 times, to verify my own conclusion.  It has not changed in the 3 times I have read the question and comments.

After years of experience of working with Dos as my favorite os, I have no recourse to accept a comment as an answer, even though I may be a day or two from the reiminder, that rin1010 is correct.  I make that decision from experience.

The question will move to PAQ and will be awarded to rin1010.

Thank you all for your input,
ComTech
Community Support
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now