How to automatically delete the paging file when you use the Sysprep.exe tool to create an image of Windows Server 2003, Windows XP, or Windows 2000 (892104)



The information in this article applies to:

  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows Server 2003, Enterprise Edition
  • Microsoft Windows Server 2003, Datacenter Edition
  • Microsoft Windows Server 2003, Datacenter Edition for Itanium-based Systems
  • Microsoft Windows Server 2003, Enterprise Edition for Itanium-based Systems
  • Microsoft Windows Small Business Server 2003, Premium Edition
  • Microsoft Windows Small Business Server 2003, Standard Edition
  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows XP Media Center Edition
  • Microsoft Windows XP Tablet PC Edition
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Professional
  • Microsoft Windows 2000 Advanced Server

Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

INTRODUCTION

This article describes how to automatically delete the paging file when you use the System Preparation tool (Sysprep.exe) to create an image of Microsoft Windows Server 2003, Windows XP, or Windows 2000. To delete the paging file, the size of the paging file must be set to zero. Deleting the paging file lets you reduce the total size of the image. The smaller image size may reduce the time that is required to copy the image.

Note We do not recommend that you use the Sysprep.exe tool on a domain controller.

MORE INFORMATION

Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. To automatically delete the paging file when you use the Sysprep.exe tool to create an image of Windows, use one of the following methods.

Method 1

  1. Click Start, click Run, type regedit in the Open box, and then click OK.
  2. Locate and then click the following registry subkey:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

  3. In the right-pane, double-click PagingFiles.
  4. Type c:\pagefile.sys 0 0 in the Value data box, and then click OK.
  5. Quit Registry Editor.
  6. Restart the system.

    Note A temporary page file that is between 10 and 20 megabytes will be created.
  7. Run the Sysprep.exe tool. The setting of the page file on the target system is resized during the first start to match the new system's memory model.
Note This registry setting makes Windows delete the paging file when you shut down Windows. You can then use the method that you want to create an image of the partition where Windows is installed and to deploy the image to the destination computers. The first time that the destination computer is restarted after you deploy the image, the paging file is resized to match the memory model of the destination computer.

Method 2

After you run Sysprep, start in recovery console and delete the Pagefile.sys file before you capture the image. For more information about how to do this, click the following article number to view the article in the Microsoft Knowledge Base: Q255205 How to Delete the Pagefile.sys File in Recovery Console

Modification Type:MajorLast Reviewed:11/8/2005
Keywords:kbenv kbMgmtServices kbhowto KB892104 kbAudITPRO