Duplicate stream from superuser.
https://superuser.com/questions/689066/changing-virtual-memory-using-batch/
This is how I do it, itβs much easier to edit than the .reg file, because the registry stores this field as a hex element. Also included is a script with two page files, if you need to delete , d:\pagefile.sys 4096 4096 for one c: \ pagefile.
start /wait /b powershell -command "Set-ItemProperty -Path 'registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management' -Name 'PagingFiles' -Value 'c:\pagefile.sys 1024 1024, d:\pagefile.sys 4096 4096'"
Here is the registry version with the same settings, but as you can see, it cannot be edited directly.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management] "PagingFiles"=hex(7):63,00,3a,00,5c,00,70,00,61,00,67,00,65,00,66,00,69,00,6c,\ 00,65,00,2e,00,73,00,79,00,73,00,20,00,31,00,30,00,32,00,34,00,20,00,31,00,\ 30,00,32,00,34,00,2c,00,20,00,64,00,3a,00,5c,00,70,00,61,00,67,00,65,00,66,\ 00,69,00,6c,00,65,00,2e,00,73,00,79,00,73,00,20,00,34,00,30,00,39,00,36,00,\ 20,00,34,00,30,00,39,00,36,00,00,00,00,00
For a true batch method, reg.exe may be an alternative to scill powershell. But the syntax is straight up binary. See the final JRV post in this thread.
http://social.technet.microsoft.com/Forums/scriptcenter/en-US/03ba4174-78ee-45ee-aa26-d8a0eb610f85/add-reg-key-to-registry-with-hex-data
This will need to be rewritten with the exact hexadecimal of all the settings you make.
REG ADD "HKCU\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v "{83E8BF99-F3C0-4475-B453-9F9E8E4548C3}" /t REG_BINARY /d 09bfe883c0f37544b4539f