Jump to content











- - - - -

Prevent Windows Setup From Creating Page/Hibernation Files?


  • Please log in to reply
3 replies to this topic

#1 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 18 June 2015 - 06:24 PM

When installing Windows, it always create both a page and hibernation file on my C drive on the SSD, both files appear there when logging into your user account for the first time. This is a problem for me, since my C is on an SSD, and Windows 7 creates a page file of around 16GB, to match the size of my RAM, and a hibernation file as well. I would like to prevent these hits to my SSD at all, even though they can be manually disabled/moved after they're created, this isn't optimal. Are there any commands/tweaks whch can prevent these files from being created at all?

 

Perhaps creating empty 0/1 byte page/hiber files (with Notepad) might work, then renaming them with a .sys extension? Or will Windows simply overwrite them?

 

Thanks!


Edited by AnonVendetta, 18 June 2015 - 06:37 PM.


#2 dickfitzwell

dickfitzwell

    Member

  • Members
  • 33 posts

Posted 18 June 2015 - 08:07 PM

Assuming Windows 7,

 

Paging file from setupcomplete.cmd:

wmic computersystem set AutomaticManagedPagefile=false
wmic PageFileSet delete

Paging file will be deleted on reboot after first log in.

 

Hibernation from unattend.xml:

<settings pass="offlineServicing">
<component name="Microsoft-Windows-Power-Policy-Definitions" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<HibernateEnabled>0</HibernateEnabled>
</component>
</settings>

If your method of install doesn't process the "OfflineServicing" pass, try "powercfg -h off" in setupcomplete.cmd  I've had instances where this method fails, the file is never created because there is not enough space available.  Then upon reboot with enough available space (like after the paging file is deleted), the file is created and "powercfg -h off" is needed again.



#3 Guest_AnonVendetta_*

Guest_AnonVendetta_*
  • Guests

Posted 18 June 2015 - 08:28 PM

Thanks for the info but.......your command would only *delete* the page file *after* it is created. In which case the writing of the file has already been done, and decreased its' lifespan by a bit. I want to prevent the file from being created at all. Your command regarding the hibernation file might work though.


Edited by AnonVendetta, 18 June 2015 - 08:29 PM.


#4 v77

v77

    Silver Member

  • Team Reboot
  • 602 posts
  •  
    France

Posted 18 June 2015 - 09:30 PM

In which case the writing of the file has already been done

 

Try to create a very large pagefile on a slow hard drive: it will be instantaneous, because nothing is written.
The space for a file can be reserved without being written.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users