1

For one of our applications, we need to configure virtual memory on a Windows Machine to be system Managed.

This can be done manually under System Properties -> Performance (Settings...) -> Performance Options Advanced Tab -> Virtual Memory Change... -> Check if a hard drive is switched to "System Managed Size".

Virtual Memory Configuration

This is great, but I have to do this for a large number of machines and would prefer to batch command or powershell script gathering this information while checking other configurations.

The closest I have found for interacting with this page is

wmic computersystem get AutomaticManagedPagefile

But this only checks if the checkbox at the top is configured, not a specific hard drive.

Does anyone have any suggestions on how to do this in a more automated fashion?

user1207381
  • 111
  • 5

1 Answers1

2

All of the pagefile parameters are stored in the registry.

Have your script manipulate the values in the following key:

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

For instance, the PagingFiles entry is a multi-valued string, with each different paging file on a separate line. The numbers following the filename represent the min and max size of that paging file.

paging file registry

If a paging file has numbers after the path name, e.g.

C:\pagefile.sys 1024 1024

Then that means it has been set to a custom 1GB static size.

Zeroes or nothing where the numbers would be indicates that the paging file is being automatically managed by the system.

Ryan Ries
  • 55,011
  • 9
  • 138
  • 197