Enable+disable pagefile.sys in registry?

pstein

Extraordinary Member
#1
Is there a way NOT to enable + disable Pagefile.sys through Systems dialog but with a Registry key?

When enabling from disbaled state it should take the previously (eventually in the past) set partition location and file size.

If this is not possible then pagefile.sys should be set to "system managed".

Be aware: I am NOT talking about just a deletion of pagefile.sys at shutdown but a complete disabling!

Peter
 


Josephur

Windows Forum Admin
Staff member
Premium Supporter
#2
Registry key wouldn't do you too well as you often need to reboot when adjusting page file settings for them to take effect.

You can however invoke WMI to manage it from the command line using WMIC. This should be done at an administrative command prompt, once you get it figured out you could quickly create a few batch files to do your pagefile bidding.

To query for current settings:
wmic pagefile list /format:list

To create a new page file:
wmic pagefileset create name="C:\pagefile.sys"
wmic pagefileset where name="C:\pagefile.sys" set InitialSize=4096,MaximumSize=4096
wmic pagefileset where name="C:\pagefile.sys" delete

You will also want to look at the pagefileset DELETE command for your needs.

To get help type wmic COMMAND /? for instance, wmic pagefile /?
 


Last edited:

ussnorway

Windows Forum Team
Staff member
Premium Supporter
#3
Fyi you can also share a pagefile across many systems on a dual/multi-boot computer but to be clear Windows is designed to run with a pagefile and expects there is one when doing tasks... having no page file can bugger up some error logging senarios and I don't recommend it for most people.
 


This website is not affiliated, owned, or endorsed by Microsoft Corporation. It is a member of the Microsoft Partner Program.