Link to home
Start Free TrialLog in
Avatar of jineshs
jineshs

asked on

Copy All Files and Directories Using just the copy command

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.
Avatar of mrdtn
mrdtn

Not using COPY.  You will need XCOPY.EXE with the "/S" option.  Check to see if XCOPY is on your boot disk.
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
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


Avatar of jineshs

ASKER

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.
Avatar of BillDL
Is the drive NTFS or FAT32?
Avatar of jineshs

ASKER

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.

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
Damn.  Sorry, jineshs, I forgot to reload the question before posting.
Avatar of jineshs

ASKER

Thanks, BillDL
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 https://www.experts-exchange.com/Community_Support/ and paste the url to this question along with your request.
https://www.experts-exchange.com/questions/20814544/Copy-All-Files-and-Directories-Using-just-the-copy-command.html

Regards, Bill
ASKER CERTIFIED SOLUTION
Avatar of PashaMod
PashaMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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.

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??
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.
Pls tell me how dos boot process, win98 occus
Thanks

adil