After posting Pagefile size bigger than 4095MB on Windows Server 2003 I had the Idea to change this registry values with powershell.
- First start powershell
- You can get all PS Drives with the command
Get-PSDrive
- Now you see the drive HKLM which stands for HKEY_LOCAL_MACHINE
- Open this Registry Key
Set-Location 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management'
- With this command you get all the key values
Get-ItemProperty -path .
- With the next command you can set the the key value
Set-ItemProperty -path . -name "PagingFiles" -value "D:\pagefile1\pagefile.sys 4096 4096"
And now the simple way with multiple entries:
$values = @" D:\pagefile1\pagefile.sys 4096 4096 D:\pagefile2\pagefile.sys 4096 4096 "@ $keys = "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" $name = "PagingFiles" Set-ItemProperty -path $keys -name $name -value $values
Superb! Thanks for sharing.
Your welcome!