#210173 - 2015-03-26 01:57 PM
WOW64AlternateRegView issue
|
TomDann
Just in Town
Registered: 2015-03-26
Posts: 3
Loc: UK
|
Hi all,
I'm using Kixtart 4.64 on Windows 7 64-bit. I need to write a value to HKLM\Software\Example. However, it keeps writing to HKLM\Software\WOW6432Node\Example. Here's my code:
$RC = setoption("WOW64AlternateRegView","on")
WriteValue("HKLM\Software\Example\Key","String","Value","REG_SZ")
Any help would be very, very much appreciated.
Kind regards
Tom
|
|
Top
|
|
|
|
#210204 - 2015-04-08 07:03 AM
Re: WOW64AlternateRegView issue
[Re: TomDann]
|
dataspike
Getting the hang of it
Registered: 2005-03-09
Posts: 89
Loc: San Diego, CA
|
Just a guess... try this.
$CurrentRegView = SetOption("WOW64AlternateRegView","OFF")
$reg = WriteValue("HKLM\Software\Example\Key","String","Value","REG_SZ")
$rc = SetOption("WOW64AlternateRegView",$CurrentRegView)
|
|
Top
|
|
|
|
#210207 - 2015-04-09 11:39 PM
Re: WOW64AlternateRegView issue
[Re: Lonkero]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Works for me as well. In fact here is an example of part of script that modifies remote production workstations that don't have keyboards or mice on them.
I use the following from an elevated command prompt to enable remote registry (which is off by default on Windows 7) - could do with KiX if you wanted as well but command line was just as fast for me in this case.
sc \\COMP02-CS01 config RemoteRegistry start= auto sc \\COMP02-CS01 start RemoteRegistry
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')
$SO=SETOPTION('WOW64AlternateRegView','on')
Dim $Update, $sComputer, $Key, $Value, $Data, $DataType
$sComputer='COMP02-CS01'
$Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN'
$Value = 'Default_Page_URL'
$Data = 'http://handcode-app/viewer/default.aspx?l=19&s=3'
$DataType = 'REG_SZ'
$sComputer=IIf(Not $sComputer,'','\\'+Join(Split($sComputer,'\'),'',3)+'\')
$Update=WriteValue($sComputer+$Key,$Value,$Data,$DataType)
|
|
Top
|
|
|
|
#210217 - 2015-04-16 05:53 PM
Re: WOW64AlternateRegView issue
[Re: NTDOC]
|
TomDann
Just in Town
Registered: 2015-03-26
Posts: 3
Loc: UK
|
Thanks for your feedback everyone.
I'm having this issue on more than one PC. I did wonder if something like group policy was affecting this, or something to do with our Windows installations, so I installed Windows 7 onto a PC and tried it fresh, without joining the domain. Unfortunately it made no difference at all.
I also tried writing to HKCU instead of HKLM - this worked correctly. Interestingly, it also worked correctly without setting the WOW64AlternateRegView flag to on...
|
|
Top
|
|
|
|
#210219 - 2015-04-23 10:54 AM
Re: WOW64AlternateRegView issue
[Re: Arend_]
|
TomDann
Just in Town
Registered: 2015-03-26
Posts: 3
Loc: UK
|
Hi Arend, I've double checked: the executor of the script is definitely an admin.
Many thanks
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
1 registered
(Henriques)
and 2516 anonymous users online.
|
|
|