Brijn
(Lurker)
2006-11-05 04:40 AM
Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

Hello,

I hope this doesn't show up as a doublepost.. I don't see my original post, guess i browsed away one step to quickly.. Anyway

I try to set the pagefile size with WRITEVALUE. With Regedit I see
"c:\pagefile.sys 512 512" as REG_MULTI_SZ

When I export the key I get:
"PagingFiles"=hex(7):43,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,35,00,31,00,32,00,20,00,35,00,31,00,\
32,00,00,00,00,00"

I tried to WRITEVALUE it as:
"c:\pagefile.sys|512|512","REG_MULTI_SZ"
or as
"hex(7):.....","REG_MULTI_SZ"

They all result in a system that doesn't boot

How ot do it?

Tx,
Bas


Les
(KiX Master)
2006-11-05 07:36 AM
Re: Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

I think you have the | in the wrong place. It should be at the end of the first line.

'C:\pagefile.sys 1536 2048|'


Glenn BarnasAdministrator
(KiX Supporter)
2006-11-06 06:20 PM
Re: Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

The "|" isn't required unless you have two value sets. For example, a 64M page file on C: and a 4G page file on another drive. The two definitions would be delimited with a "|" (as in "C:\pagefile.sys 64 64|X:\pagefile.sys 4095 4095"). The example below, taken from my SetPageFile UDF, illustrates that the "|" isn't needed, since this UDF version only defines a single pagefile.
Code:

; These 3 values are set by the UDF - force-set in this example
$_fTarget = '\\hostname\'
$_PFile = 512
$_Drive = 'X:'

$Pagefile = $_Drive + '\pagefile.sys ' + $_PFile + ' ' + $_PFile
$_RC = WriteValue($_fTarget + 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management',
'PagingFiles', $PageFile, 'REG_MULTI_SZ')



Glenn


NTDOCAdministrator
(KiX Master)
2008-09-11 11:31 PM
Re: Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

The UDF can be located on Glenn's Website for now until he posts it here.

http://www.innotechcg.com


Glenn BarnasAdministrator
(KiX Supporter)
2008-09-12 03:35 AM
Re: Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

What's with you and Lonk digging up old posts? Too much time on your hands? \:D

After reviewing the UDF, I recall that I didn't post it here because it had 2 recursive dependencies, one of which I've since deprecated. I have a newer version in the works, and will post it when it's done. Until then, the illustration I posted earlier should suffice.

If anyone wants the entire UDF, they will need the PageFile, OSInfo, Memory, and WMIUptime UDFs from my site to make it all work. PageFile is dependent on OSInfo, which in turn is dependent on both Memory and WMIUptime.

Glenn


LonkeroAdministrator
(KiX Master Guru)
2008-09-12 09:18 AM
Re: Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

lol, this is old one. but what you mean me digging up?
I've been crawling past24 and replying those. or do you mean the UDF from 02? That's a special case.
UDF posts are never old.


NTDOCAdministrator
(KiX Master)
2008-09-13 07:04 AM
Re: Setting Page file size with WRITEVALUE, MULTI_REG_SZ as hex

I dug it up because I want to change the Page file in script and doing a search on the board this came up. Then found that I could not actually locate the UDF you mentioned, thus I updated post about it in case someone else is looking for the same thing.

I'll just have to live with the dependencies for now. Thanks.