Moving pagefile.sys

Moving the Windows pagefile can help to speed up your computer if it has a conventional spinning disk hard drive. The beginning of a hard drive is usually faster than the end of the hard drive. See ServerFault - it's the same reason that a vinyl record (especially LPs) have less crackle than at the end of the record.

But moving the pagefile is very difficult - when Windows is loaded, it locks the pagefile so defragmentation programs cannot move it. You might be able to find other solutions like "PageDefrag" or "Ultra Defrag" or "Defraggler" which can move this file - but they won't actually move the page file to the start of the disk - they'll just defragment it.

There are other solutions where you create space at the start of the drive and then create pagefile.sys at the beginning. But Windows looks for a contiguous block and its very rare that you can move all the files - there's usually one or two "unmovable" files here and there.

So here's a solution to work around this.

    1. Create the file move_pagefile.myd (see below). This will create a 4GB space at the front, then put pagefile.sys after it (and if there are unmovable files, it will just fragment pagefile.sys.
    2. Download and create Hiren's Boot CD.
    3. Boot into Hiren's Boot CD.
    4. Start the Windows XP boot disk from Hiren's Boot CD.
    5. Start MyDefrag then close it (this unzips MyDefrag)
    6. In c:\ find the MyDefrag folder.
    7. Drag move_pagefile.myd onto MyDefrag.exe.
    8. Wait for the defrag to complete.
    9. Reboot.
    10. Download and install MyDefrag.
    11. Run MyDefrag.
    12. In MyDefrag, choose System Disk Monthly.

Note: Using this script may make pagefile.sys fragmented. But this is not actually a problem, so long as all the fragments are close to each other on the disk. It's fragments located far from each other (which causes "disk thrashing") and the end part of the disk (which is slower by design) that causes the most slowdowns.

move_pagefile.myd

VolumeSelect
  All
VolumeActions
  MakeGap(4GB)
  FileSelect
    FileName("pagefile.sys")
  FileActions
    ForcedFill()
  FileEnd
VolumeEnd