Microsoft KB Archive/326210

= How To Clear the Paging File When You Use the Sysprep Tool Before Imaging in the Windows Server 2003 Family =

PSS ID Number: 326210

Article Last Modified on 7/15/2004

-

The information in this article applies to:


 * Microsoft Windows Server 2003, Standard Edition
 * Microsoft Windows Server 2003, Enterprise Edition
 * Microsoft Windows Server 2003, 64-Bit Enterprise Edition
 * Microsoft Windows Server 2003, Datacenter Edition
 * Microsoft Windows Server 2003, 64-Bit Datacenter Edition
 * Microsoft Windows Server 2003, Web Edition
 * Microsoft Windows Small Business Server 2003, Premium Edition
 * Microsoft Windows Small Business Server 2003, Standard Edition

-



This article was previously published under Q326210



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

For a Microsoft Windows 2000 version of this article, see 295919.

IN THIS TASK

 * SUMMARY
 * ** Method 1
 * Method 2



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

NOTE: Microsoft does not recommend that you use Sysprep on a 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 before imaging Windows Server 2003, use one of the following methods.

back to the top

Method 1
 Start Registry Editor (Regedit.exe). Locate the PagingFiles value under the following registry key:

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

 Double-click the PagingFiles value, and then type the following:

C:\pagefile.sys 0 0

 Click OK. Quit Registry Editor. Run Sysprep.</ol>

The registry setting in Method 1 forces Windows to delete the paging file when you shut down Windows. Then, you can use your preferred method to image the installation partition and deploy it to the target computers. 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 after deployment.

back to the top

Method 2
<ol> Use either of the following procedures to create a registry (.reg) file named Zeropage.reg: <ol style="list-style-type: lower-alpha;"> Start Registry Editor (Regedit.exe).</li> Locate the PagingFiles value under the following registry key:

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

</li> Double-click the PagingFiles value, and then type the following:

C:\pagefile.sys 0 0

</li> Click OK.</li> On the File menu, click Export, and then export the key to a file named Zeropage.reg.</li> Quit Registry Editor.</li></ol>

-or-

<ul> Copy the following text to a .reg file named Zeropage.reg:

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

</li></ul> </li> Copy the following text, together with any additional Sysprep command-line parameters, to a batch file named Sysprep.cmd:

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>

back to the top

Additional query words: kbactivedirectory

Keywords: kbMgmtServices kbenv kbhowto kbHOWTOmaster KB326210

Technology: kbSBServ2003Pre kbSBServ2003Search kbSBServ2003St kbSBServSearch kbWinServ2003Data kbWinServ2003Data64bit kbWinServ2003Data64bitSearch kbWinServ2003DataSearch kbWinServ2003Ent kbWinServ2003Ent64bit kbWinServ2003Ent64bitSearch kbWinServ2003EntSearch kbWinServ2003Search kbWinServ2003St kbWinServ2003Web

-

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

© 2004 Microsoft Corporation. All rights reserved.