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".
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?
Все параметры файла подкачки хранятся в реестре.
Пусть ваш скрипт изменит значения в следующем ключе:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management
Например , запись PagingFiles
представляет собой многозначную строку, в которой каждый отдельный файл подкачки находится в отдельной строке. Цифры после имени файла представляют минимальный и максимальный размер этого файла подкачки.
Если файл подкачки имеет номера после имени пути, например,
C: \ pagefile.sys 1024 1024
Тогда это означает, что он имеет был задан нестандартный статический размер 1 ГБ.
Ноль или ничего там, где были бы числа, означает, что файл подкачки автоматически управляется системой.