http://www.ComputerBob.com/guests/how_to_clone_windows.php

Mini.

How To Clone A Win95-WinME System

by R.D. Stafford

September 20, 2005

Introduction

There are a number of methods to backup and restore your computer's files. Unfortunately, most of them require Windows to be running in order to run the Windows-based software that can backup and restore your files. That could pose a real problem if you need to restore Windows after a catastrophic problem prevents it from being able to run. Another issue that most backup methods have is that they don't allow you to backup certain critical Windows system files while Windows is running, because they are "in use" at the time and can't be copied.

The purpose of this article is to describe alternate backup/restore methods, using freely available software that can completely backup and restore your Windows system while running in DOS, without Windows running. NOTE: The backup/restore methods described in this article require you to be comfortable with running DOS commands.

I'm afraid that users of Windows NT, 2K and XP will need to look elsewhere for solutions concerning these operating systems (OS's), since they use a different disk format called NTFS, which isn't compatible with the DOS enviroment (which uses FAT and FAT32 disk formats).

The first method is normally called Drive Imaging, which backs up or restores the whole drive partition as a whole unit, but it normally doesn't allow you to retrieve specific files or folders from within the backup. The drive image software that ComputerBob has chosen is an exception to this, and even though it runs in DOS, it can also backup and restore Windows NT, 2K and XP systems using the NTFS disk format. Alas, while it is very affordable, it isn't a totally free solution like the one that I describe in this article. Still, I would certainly recommend that you consider it as another method to choose from.

There are many times when a drive image isn't the best method for a system backup. For instance, when performing a fresh Windows reload and you want to save your files but to a different location than the original. A drive image always copies the whole drive partition as a whole unit, while a drive clone copies the drive file-by-file, individually. This article describes how to clone Windows 95/98/SE/ME.

Before You Begin

To perform the method I'm going to describe will require that you have two partitions located on the same or different hard drives. This is one of the limitations of this method. If you were to attempt to copy to the same drive that you are saving the files on, it would cause an endless loop, finally filling the drive with copies of copies.

You will need to get a copy of a set of free utilities called LFN Tools from http://lfntools.sourceforge.net/. You will need the LCOPY.EXE file from that. I also recommend a good system cleanup tool such as CCleaner, found at http://www.ccleaner.com, to help cleanup all of the Temp files on your hard drive before you make a clone, so you don't clone the Temp files. You will also need to setup your computer startup to enable some type of memory manager. I recommend using HIMEM.SYS, a program that comes with Windows. Alternately, you could just create a boot disk with the needed files.

Creating The Necessary Files

For booting from your hard drive and not using a floppy, the following is a good basic AUTOEXEC.BAT and CONFIG.SYS setup that is good for both Windows and MS-DOS, which is what we will be using when cloning the drive. Your system may already have these made on it, if so, you simply need to make sure that at least the following is included. If your system has other lines or a different PATH line, use what it has but you need at least the following for decent performance. I'm going to place the LCOPY.EXE file and the batch files that will be needed in the C:\WINDOWS\COMMAND directory so they will be available everywhere, since that directory is in the PATH statement of the AUTOEXEC.BAT file.

Contents Of CONFIG.SYS

DEVICE=C:\WINDOWS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\WINDOWS\EMM386.EXE NOEMS
(Optional, but provides more upper memory for DOS apps)
DOS=HIGH,UMB
FILES=50
BUFFERS=50

Contents Of AUTOEXEC.BAT

@ECHO OFF
SET PROMPT=$P$G
SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND
SET TEMP=C:\WINDOWS\TEMP

Now we need to put the utilities that we need in the C:\WINDOWS\COMMAND diretory. Unzip the LFN TOOLs and place at least LCOPY.EXE in the C:\WINDOWS\COMMAND directory. Then create the 2 batch files, containing the commands to perform the copy/backup for you, and place them in the C:\WINDOWS\COMMAND directory. In this example, you're going to copy the whole C:\ drive to a backup directory called Backup that will be on the D: drive. To restore the files from the D: drive back to the C: drive, you just use the commands in reverse. I'll show you how to do it, and you may also make any changes you wish to fit your needs. The batch files aren't absolutely necessary, but if you repeat the cloning process often, they will make your life easier so you won't have to manually type their commands each time. You can create the batch files using any text editor such as Notepad -- Do not use a word processor though, because it will put invisible formatting codes into the files that will mess them up.

Contents Of COPYC2D.BAT

LCOPY C:\* D:\Backup\ /A /S /B /R /Y

Contents Of COPYC2C.BAT

LCOPY D:\Backup\* C:\ /A /S /B /R /Y

Using A Bootable Floppy Disk

Making a bootable floppy disk is what many users will prefer so they won't have to change their computer's startup configuration. Directions for making boot disks for several versions of Windows can be found at http://www.computerhope.com/boot.htm. I normally also add CD-Rom support as the article mentioned, but I let you decide if it's needed for your uses. Now all that is needed is to make some minor changes to the CONFIG.SYS and AUTOEXEC.BAT files, to include the requirements I mentioned earlier.

Contents Of CONFIG.SYS On The Boot Floppy Disk

DEVICE=HIMEM.SYS /TESTMEM:OFF
DEVICE=EMM386.EXE NOEMS
(Optional, but provides more upper memory for DOS apps)
DOS=HIGH,UMB
FILES=50
BUFFERS=50

Contents Of AUTOEXEC.BAT On The Boot Floppy Disk

@ECHO OFF
SET PROMPT=$P$G
SET PATH=A:\

Don't forget to copy HIMEM.SYS and EMM386.EXE from the C:\Windows directory, along with any other utilities from the C:\Windows\Command directory that you may find handy, such as FORMAT.COM (or FORMAT.EXE depending on your version), FDISK.COM, SCANDISK.EXE, EDIT.EXE and EDIT.HLP, and any others you wish. You will also need the LCOPY.EXE file from the LFN Tools package and create the same batch files that I mentioned previously, unless you are going to manually type the commands each time you want to run them.

Send In The Clones

Any time you want to clone (backup) your files, start by performing a drive cleanup using CCleaner. Then reboot your computer into MS-DOS by using the boot floppy, or (without the boot floppy) by tapping the F8 key before Windows starts, and then selecting MS-DOS Prompt from the menu. Then enter the COPYC2D command at the DOS prompt, which will copy your entire Windows C: drive to the Backup directory on your D: drive. To restore a cloned copy of your Windows files, enter the COPYD2C command at the DOS prompt, which will copy your entire Windows clone from your D: drive back to your C: drive. Restart your computer afterward.

Restoring A Clone To A Different Location

If you want, you can also restore the cloned files from the D: drive to a different location on the C: drive. Let's assume you just re-installed Windows from scratch, but you want your old, cloned files in a different location, rather than on the D: drive. You could just use a variation of the COPYD2C batch file to copy them, for example, from the D: drive to a backup directory called OldDrive on the C: hard drive. Here is how to do that:

Boot to the MS-DOS prompt.

At the DOS prompt, type the following commands and then press the [ENTER] key after each command:

C: (Ensures that you are on the main hard drive.)

CD\ (Changes to the "root" directory of the main hard drive.)

MD OldDrive (Makes a new directory called OldDrive to copy your existing cloned files into - you may change it to a different name if you like, but for DOS compatibility, I recommend that you keep the name 8 characters or less.)

Now use the following command to copy your existing cloned files from the D: drive to the OldDrive directory that you created on the C: drive:

LCOPY D:\Backup\* C:\OldDrive\ /A /S /B /R /Y

Moving Windows To A Larger Hard Drive

With variations on those basic commands, you should be able to do just about whatever you want with your files. A good example would be moving Windows to a new, larger hard drive. First, make a boot floppy disk (as stated earlier). Make sure that you have FORMAT.EXE (or FORMAT.COM, depending on your Windows version), FDISK.COM and SYS.COM on the diskette.

Turn off your computer and don't forget to use the proper electro-static precautions. Disconnect your current hard drive so there is less of a chance that you will mess it up. Next, connect your new hard drive in place of the original, setting the new drive's jumpers to single or drive select. Restart your computer and go into your system's CMOS and set it for the new drive. Most newer computers now have an Automatic drive configuration setting, which I recommend that you use.

Now start your computer with the boot floppy that you created. Next, you must partition the drive, using FDISK.COM to configure how much of the drive you want to use for the main boot partition (C:). You also should decide if you want just one partition or several. You must make the main partition a Primary partition and also set it as the Active partition. For more details on using FDISK to partition or repartition a hard drive, see Microsoft's instructions at http://support.microsoft.com/default.aspx?kbid=255867&product=w98. When you have finished partitioning the hard drive, leave the boot floppy in the floppy drive and restart the computer so it can see the changes that you just made.

Now that you have your drive partitioned, use FORMAT.EXE (or .COM) to prepare the new drive to receive your cloned Windows files from your old drive. Type the following command at the DOS Prompt:

FORMAT C:/S (The /S switch places the basic boot files on the hard drive.)

When it finishes, turn off your computer again. Leave the boot floppy in the floppy drive. This time, if you can, plug your old hard drive into the second hard drive controller (wide cable). If your computer has a secondary controller, your CD drive is probably connected to this now, so just unplug your CD drive and use its cable for this. If your computer doesn't have a secondary controller, you will need to setup your drive jumpers so that the old drive is the Slave drive and the new drive is the Master drive, and then connect your old hard drive into the second connector that's on the same wide cable as your new hard drive. When you restart your computer, remember to go into its CMOS again and set up its hard drive settings.

Now let's copy Windows from (the current D: drive -- your old hard drive) to the newer, larger drive (the current C: drive), by entering the following command at the DOS prompt:

COPYD2C

Or, if you didn't create the COPYD2C batch file, you must manually enter the following command:

LCOPY D:\* C:\ /A /S /B /R /Y

After cloning Windows from the old hard drive to the new one, shut down your computer again. Remove the boot floppy from the floppy drive. Then physically remove the old hard drive (and reconnect the CD drive to its wide cable, if necessary). Then set any jumpers on the new hard drive {if needed), reboot your computer, go into its CMOS and make any necessary changes to its drive configuration settings (to recognize the CD drive again, if you had disconnected it), and Windows should boot up with no problems.


NOTE: This is a Guest Article on the ComputerBob.com Web site. Guest Articles contain reviews, opinions, tips, and other material written by guest authors. Articles may be submitted for possible publication to the email address listed on the Contact page (a Contact link appears at the bottom of every article). ComputerBob edits all submitted articles before publishing them. By submitting an article to ComputerBob, the submitter implicitly grants ComputerBob the right to edit it and to publish it as a Guest Article on the ComputerBob.com web site. Guest Articles reflect the views of their authors only. ComputerBob is not responsible for the accuracy or reliability of Guest Articles.