Solved

Copy All Files and Directories Using just the copy command

Posted on 2003-12-02
19
118,218 Views
Last Modified: 2011-08-18
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.
0
Comment
Question by:jineshs
  • 7
  • 3
  • 3
  • +5
19 Comments
 
LVL 6

Expert Comment

by:mrdtn
ID: 9863240
Not using COPY.  You will need XCOPY.EXE with the "/S" option.  Check to see if XCOPY is on your boot disk.
0
 
LVL 6

Expert Comment

by:mrdtn
ID: 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
0
 
LVL 6

Expert Comment

by:mrdtn
ID: 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


0
 

Author Comment

by:jineshs
ID: 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.
0
 
LVL 38

Expert Comment

by:BillDL
ID: 9918228
Is the drive NTFS or FAT32?
0
 
LVL 18

Expert Comment

by:chicagoan
ID: 9918351
tried xxcopy16?
http://www.xxcopy.com/
0
 

Author Comment

by:jineshs
ID: 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.

0
 
LVL 38

Expert Comment

by:BillDL
ID: 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
0
 
LVL 38

Expert Comment

by:BillDL
ID: 9921250
Damn.  Sorry, jineshs, I forgot to reload the question before posting.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:jineshs
ID: 9921474
Thanks, BillDL
0
 
LVL 38

Expert Comment

by:BillDL
ID: 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
0
 

Accepted Solution

by:
PashaMod earned 0 total points
ID: 10097624
PAQed, with points refunded (125)

PashaMod
Community Support Moderator
0
 
LVL 2

Expert Comment

by:happispider
ID: 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
0
 
LVL 38

Expert Comment

by:BillDL
ID: 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.

0
 
LVL 4

Expert Comment

by:onlyamir007
ID: 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??
0
 
LVL 38

Expert Comment

by:BillDL
ID: 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.
0
 

Expert Comment

by:adil_786
ID: 10763682
Pls tell me how dos boot process, win98 occus
Thanks

adil
0
 
LVL 38

Expert Comment

by:BillDL
ID: 10766526
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

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…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 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

24 Experts available now in Live!

Get 1:1 Help Now