12 Steps to Cloning Windows NT Systems with SYSDIFF.EXE

Automatically install programs and files on multiple NT systems.

Clayton Johnson

July 31, 1997

13 Min Read
ITPro Today logo

When you acquire new systems for your organization, you face thechallenging task of installing Windows NT, applications, and data on them.Swapping floppy disks and CD-ROMs, entering information, changing defaults, andperforming the other required tasks to get an NT system up and running justtakes too much time, particularly when you have to do it for several systems atonce.

For example, say you need to set up 15 systems for new employees, eachsystem with the same hardware, running NT 4.0, and including 10 applications. Inaddition, you must make the necessary changes to the Registry on each system forthe Explorer interface and security. Setting up the systems manually is costlyin time and productivity. Letting users install NT and applications for youwastes their productive time and leads to installation errors. Cloning is theanswer.

Approaching Cloning
The goal of cloning is to create a duplicate system with all the originalsystem's interface changes, tweaks, installed software, and options. However,each system you clone must be a unique system on the network. Merely copying allthe files with XCOPY.EXE won't work because a copied system has the samesecurity identifiers (SIDs) as the original for the operating system, machinename, and shares. The problem with such copying is that to ensure connectivitywith servers, each cloned system must have unique SIDs, especially the machinename. Also, the cloning process must be fast; if not, it isn't worth the effort.And you need to be able to clone NT systems without incurring extra costs fornecessities such as software and licensing.

To meet these requirements, the best approach to cloning is to take acurrently set-up system, make sure it has the applications, data, and settingsyou want, and duplicate that machine's setup (except for the SIDs) on othersystems. One cloning method is to use Computer Profile Setup (CPS), a set ofutilities in the Windows NT 3.51 Resource Kit that lets you create a mastersystem configuration that you can copy to other machines. However, CPS isdifficult to use and doesn't always create unique SIDs. Third-party cloningproducts, such as Ghost from Binary Software and DriveCopy from PowerQuest arealternatives. Such products work well for cloning Windows 3.x and Windows 95systems. However, for NT cloning, these products have some limitations. Forexample, these products can't deal with NT's requirement for unique computernames and IP addresses, nor can they handle differences in hardware, drivers,and settings. An easier, more reliable method is SYSDIFF.EXE, a tool on theWindows NT Server 4.0 CD-ROM (documentation for SYSDIFF.EXE is in the NT 4.0Resource Kit).

SYSDIFF.EXE
The SYSDIFF.EXE utility lets you clone system modifications, applications,and changes--but not the NT operating system. You must install NT on the systemsbefore using SYSDIFF.EXE for cloning; I explain a method for combiningthe NT installation and cloning process later. SYSDIFF.EXE can help make thenecessary interface changes and connections to the network and shares. It canalso help install application files and implement the necessary Registry changesassociated with those files.

You can use SYSDIFF.EXE to perform these tasks in two ways, both of which Iexplain in this article. You can combine Registry changes and the binary filesrequired to run the applications, putting them into a difference file (afile that identifies differences between the original and current configurationsof the system being cloned) and then copy the difference file to the new system.Alternatively, you can use SYSDIFF.EXE to make only Registry changes. Thisapproach creates an .INF file. You then copy the files by performing a backupand restore or by recording the files on a CD-recordable drive and copying themto the target system. Whether or not you include all the programs and auxiliaryfiles, when you decide to clone your system, the most important part of theoperation is the Registry.

SYSDIFF.EXE Prerequisites
For SYSDIFF.EXE to work correctly, several things are necessary, including

  • a master system with NT Server or Workstation 4.0 installed. You will makenecessary changes on and add applications to this system.

  • a share on the server for the SYSDIFF.EXE application and auxiliaryfiles, with sufficient space for all the applications to be installed on themaster system. In this article, this share is in D:BIN, shared as\SERVER1SOURCE.

  • SYSDIFF.EXE, which creates and applies the necessary files for cloning. Itis on the NT 4.0 Server CD-ROM in the SUPPORTDEPTOOLSplatformdirectory. Copy it to the share you've reserved on the server.

  • the snapshot file, which SYSDIFF.EXE creates to record the currentsystem status (i.e., create the before picture).

  • SYSDIFF.INF, which controls what SYSDIFF.EXE looks for when itcreates its snapshot and difference files. Copy this file from the CD-ROM to theshare.

  • the difference file (i.e., the after picture), which SYSDIFF.EXEcreates and which includes the changes made to the Registry, application files,and files associated with them.

  • the target systems, which already have NT installed. You'll copy thechanges in the difference file to these systems.

If any of these parts are missing, preparing and implementing the cloneinstallations will not work.

Step-by-Step Cloning: The Difference File Method
Here are 12 steps for cloning NT systems, using SYSDIFF.EXE to create adifference file that you'll copy to the target system.

  1. Install NT Workstation or Server 4.0 on themaster system. However, wait to install applications until step 5.

  2. At the master system, map a drive letter toa share on the server (for example, X: is mapped to D:BIN).

    1. At the server, copy the SYSDIFF.EXEand SYSDIFF.INF files from the NT 4.0 Server CD-ROM in theSUPPORTDEPTOOLSPLATFORM directory to D:BIN.

      Tip: Run the SYSDIFF.EXE application from the server's shareddirectory. Store the snapshot and difference files in this directory, as well.You might get slightly better performance by running SYSDIFF.EXE from your localdrive, but doing so requires more manual copying of files.

      Warning: Putting the difference file on your local drive on themaster system might cause SYSDIFF.EXE to create a monstrous file or even hangthe process. The system might get caught in a loop, trying to copy the file itis copying to. To improve performance by using your local drive for storing thedifference file, add the path in which the difference file will be stored to theSYSDIFF.INF file under the [ExcludeDirectoryTrees] section. Then, SYSDIFF.EXEwill ignore and exclude the difference file from the snapshot and differencefile process.

    2. At the master system, run the command

      SYSDIFF /SNAP X:before.img

      (you can use any 32-bit valid filename). This command takes a snapshot ofthe current NT installation and of all installed files and settings. Thesnapshot includes the directories and files, Registry, and .INI files.Figure 1shows the SYSDIFF.EXE procedure in process. When finished with the process,SYSDIFF notifies you with a "Snapshot complete" message in a dialogbox. (You can use the procedures listed here to add software to an installedsystem. When you run the snapshot, it takes a current picture. From that point,adding other items produces a difference file.)

    3. Set up NT on the master system the way youwant, including (but not limited to) shares, printers, and network connections.

    4. Make Registry changes on the master systemby editing the Registry directly or through the Control Panel. (For moreinformation about editing the Registry, see Christa Anderson, "Care andFeeding of the Registry," December 1996.)

    5. Add software applications to the mastersystem.

    6. Set up applications as you want, includingdefault directories, toolbars, preferences, and other settings.

      Warning:Before performing the next step to create the difference file, reboot the mastersystem to ensure all functions relating to the application installation arecompleted and all files have been closed.

    7. Run the command

      SYSDIFF /DIFF X:before.img X:after.img

      at the master system, with X:before.img being the snapshot file and pathand X:after.img being the difference file and path. (You can give thedifference file any extension you want; I usually don't give it an extension,because of the difficulty in using the command line and the decimal place.)SYSDIFF.EXE takes a snapshot of the entire system again, compares the newsnapshot to the old one as shown in Screen 1, and writes thedifference file to the hard disk.

      The difference file includes all changes, directories, and files and can bean extremely large file. The difference file includes the directories and files(as you see in Screen 2), Registry changes (Screen 3 shows these changes), and.INI files (which are in Screen 4). Once the difference file has been written todisk, a dialog box appears with a "Diff complete" message.

    8. Install NT on the target system.

      Warning:All systems receiving the difference file must have NT in a directory that hasthe same name on each system.

    9. On the target system, map a drive letter tothe snapshot/difference file location, such as X: mapped to the server'sD:BIN.

    10. Use

      SYSDIFF/m/applyX:after.img

      (X:after.img is the difference file and path) to apply the difference fileto the target system. SYSDIFF.EXE copies all the binary files to the targetsystem and then makes the necessary changes to the Registry and .INI files. Thebenefit of using SYSDIFF.EXE is that you don't need to use the application setupfunctions to install the applications.

      As soon as you get one system started in the cloning process, you can startanother. NT networking lets multiple systems access the same file. The onlylimitation to having multiple systems access the server is the amount of trafficeach system generates.

      Tip: At this point, you can simultaneously apply the differencefile to as many NT systems as you can connect to the network. However, firsttest the process on one system to ensure that the procedure works exactly asplanned. Then, attach to the network and clone away.

    When cloning, you might encounter error messages. "Possible ErrorMessages," lists some errors I've found and fixes for them.

    Combining NT Installation and Cloning
    A great shortcut to improve cloning performance is to combine theinstallation and cloning processes into one command. You can take advantage of atrick similar to one hardware manufacturers use: SETUPMGR.EXE lets you create ananswer file (i.e., a text-file NT installation script) that performs anunattended installation. (For more information about using an answer file andSETUPMGR.EXE to perform an unattended installation, see Christa Anderson, "DesigningUnattended NT Installations," March 1997.)

    During the NT installation, NT automatically copies all directories andfiles that are in a directory called $OEM$, if it's directly under the NTinstallation files (usually I386 on the NT CD-ROM, but copied to D:BINof theserver in this example). SYSDIFF.EXE and its options automatically create thatdirectory for you, including all the necessary files. NT then installs the fileson the target system and makes the necessary Registry and .INI file changes,too.

    To use this alternative procedure, perform steps 1 through 11 to create thedifference file. Then you must prepare the target system for file installation.Finally, you create the .INF file by selecting the NT Start menu, Run, and thenentering the following:

    D:BinSYSDIFF.EXE /inf d:binafter.img d:bin2

    D:binafter.img is the path and name of the difference file, and d:bin2 isthe location for the .INF file and changes to the system.

    The .INF file is given the same name as the difference file, except thatthe .INF file has an INF extension (in this case, AFTER.INF). Screen 5 shows thecontents of the .INF file; you can display the file in Notepad or in any othertext editor or word processor.

    With the setup information you supply to SETUPMGR.EXE and the $OEM$directory you created with the /INF option and SYSDIFF.EXE, you have thenecessary files to perform a complete installation with NT, services,applications, Registry settings, and all preferences set. After you boot thetarget system and connect it to the server, start the NT installation. If younamed the answer file UNATTENDED.TXT in D:BIN, the command line you use is

    WINNT /U:D:BINUNATTEND.TXT

    Notice you do not need to specify the $OEM$ directory or add anything to getthe system to install the applications. Installation occurs as a function of theinstallation, with no added input on your part. Once the installation iscomplete, NT and all your applications are installed on the target system.

    Streamlining the SYSDIFF Process
    The SYSDIFF.INF file, which comes with SYSDIFF.EXE on the NT Server 4.0CD-ROM, controls the SYSDIFF process. By editing the SYSDIFF.INF file, you canmake the cloning process smoother, faster, and more space-efficient. TheSYSDIFF.INF file is an inclusion/exclusion file that determines whatSYSDIFF.EXE will or won't review when it creates the snapshot and differencefiles. The SYSDIFF.INF file on the CD-ROM has nine sections:

    • [Version]

    • [ExcludeDrives]

    • [ExcludeDirectoryTrees]

    • [ExcludeSingleDirectories]

    • [ExcludeFiles]

    • [IncludeFilesInDir]

    • [ExcludeRegistryKeys]

    • [ExcludeRegistryTrees]

    • [ExcludeRegistryValues]

    Entries in the SYSDIFF.INF file (as long as the file is in the samedirectory as SYSDIFF.EXE) direct the cloning process. For example, suppose youadd drive E to the [ExcludeDrives] section. Then SYSDIFF.EXE will not lookat that drive during the creation of the snapshot or difference file. Excludinga drive that contains no useful information can save a great deal of time in thecloning process. However, you need to be very careful about removing defaultentries in the SYSDIFF.INF file. By doing so, you can make the cloningprocess unsuccessful.

    Overcoming Side Effects
    Using SYSDIFF.EXE and the difference file to install applications has oneside-effect: Files transferred to the target system inherit the date of theinstallation instead of retaining their original date when they are written tothe hard drive, as Screen 6 shows. Thus, the contents of the difference file(Registry changes, .INI file changes, and program and data files new since thefirst snapshot) are all re-dated when they're copied to the target system.

    If you want to retain the files' original dates, you can split the Registryand .INI changes from the files, apply the Registry and .INI changes, and thencopy the files separately instead of using the difference file to install thesoftware. Create the AFTER.INF file as explained in the previous section. Thenyou can change Registry and .INI files on the target system by adding the .INFfile to the list of files to use at installation. You do this task throughSETUPMGR.EXE. Start SETUPMGR.EXE, and choose Advanced Options. Then select theBoot Files tab. Add the file path and name, as in Screen 7. When you use theanswer file to install NT, the Registry and .INI file changes occurautomatically.

    After you make the Registry and .INI changes, your final step is to copythe directories and files to complete the installation. The .INF file-creationprocedure conveniently copies all files in the difference file to subdirectoriesunder the $OEM$ subdirectory (which you see in Screen 8). When you copy thefiles to this subdirectory, their dates change to the current date. Using filesin the $OEM$ subdirectory can compromise your security if you date-stamp yourfiles.

    Although you have copied the files to the $OEM$ subdirectory, you don'tneed to include them in the installation process if you want to preserve thefiles' original dates and times. Instead of copying and using the files under$OEM$, install NT with an answer file and then copy the originals with XCOPY.EXEto retain file dates and times.

    Repair the Registry
    In addition to cloning, you can use the .INF file to correct a Registryproblem with an application (e.g., corrupted files). Ordinarily, you need toreinstall the application and then make the necessary changes to menus,toolbars, and preferences. However, having a list of every change theapplication installation and modification processes made to the Registry and.INI files would save you a tremendous amount of time in restoring yourapplication.

    If you create a difference file after you install an application, you havethis list of changes. To repair the Registry, simply create a loadable .INF filefrom the difference file as explained earlier. You can then load the .INF fileback into the system through SETUPMGR.EXE. But instead of doing anotherinstallation over the current NT installation, choose to do an update. Includethe .INF file by selecting the Advanced Options and Boot Files options inSETUPMGR.EXE. The Registry will then be updated with the .INF file information.

    Clone Away!
    SYSDIFF.EXE is a versatile tool. You can use it to install NT and all thesoftware you need on multiple systems with the difference file or .INF filemethod. And, the .INF file created with SYSDIFF.EXE lets you repair Registryfiles. Let me know how SYSDIFF.EXE's cloning power works for you

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like