This article describes how to use the Microsoft Sysprep tool to automate the deletion of a paging file before creating a Windows Server 2003 image (to reduce the time to copy an image or to reduce the overall size of the image).
Note: Microsoft recommends that you do not use Sysprep on a domain controller.
Warning: Improper use of Registry Editor can cause serious problems that may require you to reinstall your operating system. Microsoft is not guaranteed to resolve problems caused by improper use of the Registry Editor. Using Registry Editor requires your own risk.
To use Sysprep to finish deleting a paging file before creating a Windows Server 2003 image, use one of the following methods.
Method 1
Start the Registry Editor (Regedit.exe).
Locate the PagingFiles value in the following registry key:
Hkey_local_machine\system\currentcontrolset\control\sessionmanager\memory Management
Double-click the PagingFiles value, and then type the following:
C:\pagefile.sys00
Click OK.
Quit Registry Editor.
Then run Sysprep.
The registry setting in Method 1 forces Windows to delete the paging file when you close Windows. You can then use the method you prefer to create an installation partition image and deploy it to the target computer. During the first boot of the target system, the paging file settings above it will resize to match the memory modules of the newly deployed system. (Programming Entry Network)
Method 2
Use any of the following procedures to create a registry (. reg) file named Zeropage.reg:
Start the Registry Editor (Regedit.exe).
Locate the PagingFiles value in the following registry key:
Hkey_local_machine\system\currentcontrolset\control\sessionmanager\memory Management
Double-click the PagingFiles value, and then type the following:
C:\pagefile.sys00
Click OK.
On the File menu, click Export, and then export the item to a file named Zeropage.reg.
Quit Registry Editor.
Copy the following text to a. reg file named Zeropage.reg:
WindowsRegistryEditorVersion5.00
[Hkey_local_machine\system\currentcontrolset\control\sessionmanager\memory Management]
"PagingFiles" =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 other Sysprep command-line arguments to a batch file named Sysprep.cmd:
Regedit/sa:\zeropage.reg
A:\sysprep-noreboot-pnp
Marks a new computer memory match on the computer.