Microsoft KB Archive/295919

= HOW TO: Clear the Paging File When You Use the Sysprep Tool Before Imaging Windows 2000 =

PSS ID Number: 295919

Article Last Modified on 9/19/2003

-

The information in this article applies to:


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional

-



This article was previously published under Q295919





For a Microsoft Windows Server 2003 version of this article, see 326210.

IN THIS TASK

 * SUMMARY
 * ** Method 1
 * Method 2

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



SUMMARY
This article describes how to automate the removal of a paging file by using the Microsoft System Preparation (Sysprep) tool prior to imaging Windows 2000 (to reduce the time to copy an image or reduce its total size).

NOTE: It is not recommended to use Sysprep to run against a Windows 2000 domain controller. 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 automate the removal of the paging file by using Sysprep prior to imaging Windows 2000, use one of the following methods:

back to the top

Method 1
 To reset the paging file on drive C to 0 (zero), change the following registry entry:

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

Type the following PagingFiles value:

C:\pagefile.sys 0 0

 Run Sysprep. Reboot and image the master system. The setting of the page file on the target system is resized during the first boot on the target system to match the new system's memory model once deployed.

back to the top

Method 2
 To reset the paging file on drive C to 0 (zero), copy the following text to a .reg file named &quot;Zeropage.reg&quot;:

Windows Registry Editor Version 5.00

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

&quot;PagingFiles&quot;=hex(7):43,00,3a,00,5c,00,70,00,61,00,67,00,65,00,66,00,69,00,6c,\

00,65,00,2e,00,73,00,79,00,73,00,20,00,30,00,20,00,30,00,00,00,00,00

 Copy the following text along with any additional Sysprep command-line parameters to a batch file named &quot;Sysprep.cmd&quot;:

regedit /s a:\zeropage.reg

a:\sysprep -noreboot -pnp

NOTE: The paging file setting is automatically set or resized during the first restart of the computer to match the memory of the new computer on the target computer.

</li> Run the Sysprep.cmd file to reset the paging file and to start Sysprep.</li></ol>

The registry setting that uses method 1 can force Windows to delete the paging file when you shut down your programs prior to imaging. Then, you can use your preferred method to image the installation partition and deploy it out to the target computers.

When you use method 2, the paging file is set to zero (0). After you have made this setting, use Regedit to export the following value:  Start Registry Editor (Regedt32.exe).</li> Locate and click the PagingFiles value under the following key in the registry:

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

</li> On the Edit menu, click Modify Binary Data, type: c:\pagefile.sys 0 0, and then click OK.</li> On the File menu, click Export, and then export the key to a file named &quot;Zeropage.reg&quot;.</li> Quit Registry Editor.</li></ol>

This value is in hexadecimal format. Typically, if the value is edited in Regedit, the value may resemble the following format: &quot;C:\Pagefile.sys 200 300&quot;. Or, if the value is set to zero, the format can be: &quot;C:\Pagefile.sys 0 0&quot;. Or, the value may not contain any values. back to the top

Keywords: kbenv kbHOWTOmaster KB295919

Technology: kbwin2000AdvServ kbwin2000AdvServSearch kbwin2000Pro kbwin2000ProSearch kbwin2000Search kbwin2000Serv kbwin2000ServSearch kbWinAdvServSearch

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© 2004 Microsoft Corporation. All rights reserved.