Click here for important information about

(IBM PC 5150) copy entire hard drive

September 20, 2011 at 17:13:05
Specs: MS-DOS, 8088 640kb
Hello friends:
First sorry for my English.

I need some help with a batch file
I have an IBM PC 5150 with a 20MB hard drive and want to make a copy of all files (subdirectories, hidden files and system files) to another hard drive d: automatically.
I do not want to use the ghost program and do not want to use some program to do a backup.

I can boot my computer from a floppy or from the hard disk itself.
On the hard drive I have the MS-DOS 4.10.
To boot from the floppy I can do with the MS-DOS 3, MS-DOS 4.10, MS-DOS 5 and MS-DOS 6.22.
I know the file xcopy, but I need to also copy the hidden files and need the switch / h, but these versions of MS-DOS do not.
I'm thinking in this code but I need to improve because I need to copy all files automatically.

@echo off

if not exist *.* goto Error
attrib +a *.*


c: xcopy *.* d:\ /m

if errorlevel 5 goto Error
if errorlevel 4 goto Go
if errorlevel 1 goto Error
if errorlevel 0 goto End

echo ¡ERROR!
goto End

echo ¡O.K!

Please I need some help.
Thanks and best regards

See More: (IBM PC 5150) copy entire hard drive

September 20, 2011 at 21:13:43
The only hidden files dos creates is msdos.sys and io.sys.

Suggest you set up the second drive in the PC. If it's MFM or RLL you'll need to LLF it. That utility shoud be on the card the drive's are connected to. Usually you run DEBUG then type in g=c:800:5, although it may be another address. You'll need to check the manual for the card.

You may want to disconnect the working drive while you do that in case you get the drives mxed up.

When it's done, you can connect both drives--the working one as c: and the new one as d:. At the dos prompt you'll need to run FDISK to partition it and FORMAT to format it. When you're done, at the dos prompt do a sys d: and enter to transfer the system files.

When it's done you can use XCOPY to copy all the files. I believe it's XCOPY C:\*.* D:/E.

If you've created hidden files or directories yourself you should probably run ATTRIB in each directory and unhide them. Then use xcopy.

That'll work for 6.22, not sure about earlier versions.

Report •

September 21, 2011 at 02:38:14
Hi Izham,

Daveincaps suggestion using SYS before XCOPY is good. However the xcopy command/switches I would use is:-

XCOPY C:\*.* D: /a /e /v


There is a note there regarding the /h switch.

Have you considered upgrading C: to dos version 6.22?

As a matter of interest, where are you located? I am in Hammersmith, West London.

unsure why you advocate LLF (low level format) for MFM or RLL disks
regards - Mike.

Good Luck - Keep us posted.

Report •

September 21, 2011 at 11:15:14
Hello again:
Thanks for your answers and your help.
Well actually my hard drive c: is a Seagate ST-225 MFM, but my hard drive D: is a unit-Zip100 Iomega.
This is possible thanks to a driver called palmzip.sys and you can buy for little money. And it works very well.
Actually I'm looking for a batch file that can do this automatically. A batch file to tour the entire hard drive and copy the files and subdirectories one by one.
My drive C: has subdirectories and files are also hidden here.
Hi Mike, I live in Spain.

Report •

Related Solutions

September 21, 2011 at 19:37:48
With 8088 machines and 8-bit hard drive cards and MFM or RLL drives you had to do a LLF to match the drive to the card. With 16-bit cards in 286's I don't think you had to do that.

If you're looking to copy a drive there's no need for a batch file. Or if you want one it would just need one line--the XCOPY line. Don't make things more complicated than they need to be.

There's also XXCOPY. It's a third party utility that works like xcopy but has more switch options.

Report •

September 22, 2011 at 02:07:49
Hi Izham - generally there are 2 or 3 system files which are hidden.
However do you need these on the 'other' disk, as they are used to boot the pc.
These are the ones copied by the SYS command.

You advise you have other files which are hidden.
Are you or their applications 'hiding' them?
If you, why?

Suggest experimenting with XCOPY or XXCOPY to see if these are copied.

Daveincaps advice to keep it simple is good.

Good Luck - Keep us posted.

Report •

Ask Question