Question

Copy All Files and Directories Using just the copy command

Asked by: jineshs

Is there a way to copy all the files and subdirectories under a directories using just the DOS copy command. I am trying to copy large directory from a laptop that would not boot. I am able to list the files after booting using a dos boot disk.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2003-12-02 at 15:48:24ID20814544
Tags

copy

,

dos

,

directory

,

command

Topic

MS DOS

Participating Experts
7
Points
0
Comments
19

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Get files in directory and subdirectories
    Hi, Does someone has a code that allows me to retrieve files in a directory and it's subdirectories into an array ? The array should contain the filenames (including the path) The ADIR() only retrieve files in a specified directory. It doesn't do sub-directories. You advi...
  2. Boot Disk?
    Experts, OS: WIN2K PROFFESIONAL I need to find a boot disk that has HD drivers so I can format my HD. I went to www.bootdisc.com to find a MSDOS driver and found plenty, but none of them allow me access C: (HD). Only the A:(floppy) is found. Any suggestions? The reaso...
  3. Delete directory and all subdirectory method
    Is there any command for deleting a directory and all subdirectories and/or files? Or does anyone have a good script (*.cmd) file for doing this?
  4. CSC directory AND subdirectories
    Windows XP Pro Sp2 on a domain networked workstation Ok i've looked at the articles on this site dealing with the c:\windows\csc directory and have read that the best way to clear out this cache is to go to folder options and on the offline files tab to CTRL + Shift + LClick...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: mrdtnPosted on 2003-12-02 at 17:05:57ID: 9863240

Not using COPY.  You will need XCOPY.EXE with the "/S" option.  Check to see if XCOPY is on your boot disk.

 

by: mrdtnPosted on 2003-12-02 at 20:16:05ID: 9864055

Furthermore, if you want to backup from a directory rather than a root drive, I would combine the features of the SUBST command (you will need the SUBST.EXE file on your boot disk or some accessible path, as the SUBST command is also external).

Assumming LASTDRIVE is set accordingly, you could use the following:

For example, lets assume the directory on your laptop which you want to rescue is:

"c:\backup\archive\dir"

Then (for example - I use "x" in the subst command below.  You can use any drive letter as long as the bootdisk has LASTDRIVE set >= the drive letter).  Also, you did not specify what media you would be copying the data to.  Let's assume it's another harddrive in the system or perhaps a removable drive (such as a ZIP or some other USB or Firewire device) and it's drive letter assigned by the boot disk is "F:"

A:> subst x: c:\backup\archive\dir"
A:> xcopy /s x: f:

The commands above should do as you like.  If The drive "F:" has stuff on it already, you may wish to create a seperate folder on the drive and use yet another SUBST to alias the directory, for example:

A:> cd f
F:> md rescue
F:> cd rescue
F:\rescue> subst y: .
F:\rescue> a:
A:> xcopy /s x: y:

--

Hope this helps you,

mrdtn

 

by: mrdtnPosted on 2003-12-02 at 20:18:06ID: 9864061

There is a leftover trailing quote which should not be there in my last post:

A:> subst x: c:\backup\archive\dir"

SHOULD BE:

A:> subst x: c:\backup\archive\dir


 

by: jineshsPosted on 2003-12-04 at 10:13:43ID: 9876301

Xcopy would not work as I don't have that available with the boot that I have.
I have a laptop that has a corrupt windows 2000 and is not repairable. I have boot up using ghost boot disk and so I am able to connect to the network and copy the files to the network. The ghost boot disk has PC-Dos as the OS.
There is a folder which has a lot of subfolders which I need to copy and the only command available is COPY.
I tried to put the xcopy file on a floppy and use that on the laptop but it says that it is 'incorrect dos version'. The xcopy was from msdos 6.22.
Any other suggestion would be helpful.

 

by: BillDLPosted on 2003-12-10 at 21:08:35ID: 9918228

Is the drive NTFS or FAT32?

 

by: chicagoanPosted on 2003-12-10 at 21:47:54ID: 9918351

tried xxcopy16?
http://www.xxcopy.com/

 

by: jineshsPosted on 2003-12-11 at 06:28:16ID: 9920272

The drive was in NTFS.
I have not tried xxcopy16.

I was able to get it work. I boot up the Laptop using the ghost network boot disk so I can map to a network drive. Then I use utility readntfs (http://www.ntfs.com) so I could read the files on the hard drive. The readntfs utility has a copy command which copies all the files and folder under the folder selected.

Thanks everybody for all you help.

 

by: BillDLPosted on 2003-12-11 at 08:37:32ID: 9921236

Perhaps this utility might help:

ReadNTFS

NTFS Reader for DOS provides read access to NTFS drives from the MS DOS environment. It supports long filenames as well as compressed and fragmented files. NTFS Reader for DOS allows you to preview the files on NTFS and copy them from NTFS to FAT volumes or network drives. In order to use the software you need to copy the readntfs.exe file to a bootable floppy disk and boot from it.

http://paulsxp.com/files/readntfs.zip  789KB

http://www.ntfs.com/

http://www.binarica.com/data/about/readntfs.html

 

by: BillDLPosted on 2003-12-11 at 08:38:30ID: 9921250

Damn.  Sorry, jineshs, I forgot to reload the question before posting.

 

by: jineshsPosted on 2003-12-11 at 09:03:06ID: 9921474

Thanks, BillDL

 

by: BillDLPosted on 2003-12-11 at 19:22:46ID: 9925626

No problem, jineshs.  In view of the fact that you have found the solution to this problem, and sorted things out, then perhaps you should ask for your points back and ask for the question to be closed.  If however, you did feel that any expert's comments guided you towards this solution, then you could accept that expert's comment.  The choice is yours, but in the end the solution was yours.

To ask for closure and return of points, post a zero-value comment for the attention of the administrators in http://www.experts-exchange.com/Community_Support/ and paste the url to this question along with your request.
http://www.experts-exchange.com/Operating_Systems/MSDOS/Q_20814544.html

Regards, Bill

 

by: PashaModPosted on 2004-01-12 at 11:40:00ID: 10097624

PAQed, with points refunded (125)

PashaMod
Community Support Moderator

 

by: happispiderPosted on 2004-02-06 at 16:12:04ID: 10295538

In Win98 original (not SE) xcopy command does NOT copy hidden or system files ever.  Using either WUCSP.EXE or ADVPACK.EXE (updaters for Win98) you can upgrade xcopy.exe.  It will only copy hidden system files from within Windows.  My favorite xcopy command is

xcopy source dest /s /e /c /h /k /r

/s=Copy subdirectories
/e=Copy empty subdirectories also
/c=Continue copying even if an error occurs.  Important if trying copy files in use.
/h=Copy hidden files
/k=Copy system files (I think)
/r=Copy read only files (I think)
example: xcopy c:\*.* d:\ /s /e /c /h /k /r... All of C to drive D

 

by: BillDLPosted on 2004-02-07 at 00:36:18ID: 10297206

That is strange, happispider.  I have used the bog-standard xcopy and xcopy32 from the Win 98 First Edition CD (4.10.1998 April 1998) under \tools\oldmsdos.  They are both dated 11 May 1998 20:01:00 and are fully capable of copying hidden files without any updates, as long as the appropriate switch is used.

The reason for this is the presence of the file xcopy32.mod which contains the command options available to xcopy.exe and xcopy32.exe.  Without this file, an error message will be issued from either of these .exe's : "Bad or missing XCOPY32.MOD"

You seem to be unsure of a couple of the switches.  This is easily resolved for accuracy:

xcopy /? > c:\windows\desktop\xcopy_syntax.txt

Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/W]
                           [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
                           [/K] [/N]

source       Specifies the file(s) to copy.
destination  Specifies the location and/or name of new files.

/A  - Copies files with the archive attribute set, doesn't change the attribute.
/M - Copies files with the archive attribute set, turns off the archive attribute.
/D:date - Copies files changed on or after the specified date.
               If no date is given, copies only those files whose source time is newer than the destination time.
/P - Prompts you before creating each destination file.
/S - Copies directories and subdirectories except empty ones.
/E - Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.
/W - Prompts you to press a key before copying.
/C - Continues copying even if errors occur.
/I - If destination does not exist and copying more than one file, assumes that destination must be a directory.
/Q -  Does not display file names while copying.
/F -  Displays full source and destination file names while copying.
/L -  Displays files that would be copied.
/H -  Copies hidden and system files also.  *****
/R  - Overwrites read-only files. *****
/T -  Creates directory structure, but does not copy files. Does not include empty directories or subdirectories. /T /E includes empty directories and subdirectories.
/U-   Updates the files that already exist in destination.
/K -  Copies attributes. Normal Xcopy will reset read-only attributes. *****
/Y -  Overwrites existing files without prompting.
/-Y - Prompts you before overwriting existing files.
/N - Copy using the generated short names.

You will find that xcopy.exe and xcopy32.exe are found in "WIN98_43.CAB".  I can't see immediately which .cab file the .mod file is contained in, but the following commands will extract them (where G:\ is your CD Rom):

@echo off
EXTRACT /Y /A  G:\win98\BASE4.CAB  xcopy.exe  /L c:\windows\command
EXTRACT /Y /A  G:\win98\BASE4.CAB  xcopy32.exe  /L c:\windows\command
EXTRACT /Y /A  G:\win98\BASE4.CAB  xcopy32.mod  /L c:\windows\command

The reason I say this, is because those are the files that are installed courtesy of the setup routine.  The same file versions are present in the \tools\oldmsdos folder.

 

by: onlyamir007Posted on 2004-03-06 at 00:54:50ID: 10530088

What about he need without prompt copy I mean if he trying to copy all files and that command will give “Overwrite D:\a2\files_done.doc (Yes/No/All)?” is there any way void this prompt??

 

by: BillDLPosted on 2004-03-06 at 06:38:32ID: 10531022

XCOPY
 /Y     Overwrites existing files without prompting
 /-Y    Prompts you before overwriting existing files

COPY
  /Y     Overwrites existing files without prompting
  /-Y    Prompts you before overwriting existing files

EXTRACT
Default    Prompts you before overwriting existing files
  /Y          Overwrites existing files without prompting
 
Please note that this question is closed.

 

by: adil_786Posted on 2004-04-06 at 00:37:20ID: 10763682

Pls tell me how dos boot process, win98 occus
Thanks

adil

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...