Page 1 of 1 1
Topic Options
#210173 - 2015-03-26 01:57 PM WOW64AlternateRegView issue
TomDann Offline
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:

 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 Offline
Getting the hang of it

Registered: 2005-03-09
Posts: 89
Loc: San Diego, CA
Just a guess... try this.

 Code:
$CurrentRegView = SetOption("WOW64AlternateRegView","OFF")
$reg = WriteValue("HKLM\Software\Example\Key","String","Value","REG_SZ")
$rc = SetOption("WOW64AlternateRegView",$CurrentRegView)

Top
#210205 - 2015-04-08 09:53 PM Re: WOW64AlternateRegView issue [Re: dataspike]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
it got to be on.

Tom, are you having this issue only with one computer?
I just tried it myself and works just fine. on top of that, it has been used for years without issues. the only thing that comes to mind is, you have a computer with messed up windows api functions.

have you tried it on fresh windows install?
_________________________
!

download KiXnet

Top
#210207 - 2015-04-09 11:39 PM Re: WOW64AlternateRegView issue [Re: Lonkero]
NTDOC Administrator Offline
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



 Code:
$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 Offline
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
#210218 - 2015-04-17 10:07 AM Re: WOW64AlternateRegView issue [Re: TomDann]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1896
Loc: Hilversum, The Netherlands
Tom: Sounds like a permission problem, HKLM requires (the executer of the script) to be a member of the target machine's Administrators group.
Top
#210219 - 2015-04-23 10:54 AM Re: WOW64AlternateRegView issue [Re: Arend_]
TomDann Offline
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
#210220 - 2015-04-23 01:55 PM Re: WOW64AlternateRegView issue [Re: TomDann]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, I decided to go ahead and test with a fresh copy of kix 4.64 from the website, checked the md5. so far so good.

the script didn't work out of bat since normal user doesn't have rights. stupidly, the error is 55, which has nothing to do with what the actual issue is.

opened an elevated command prompt and ran it again.

works perfectly.
_________________________
!

download KiXnet

Top
#210221 - 2015-04-23 05:31 PM Re: WOW64AlternateRegView issue [Re: TomDann]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4403
Loc: New Jersey
"An admin", as in a "member of the local administrators group", or "THE administrator"??

From Vista on up, membership in the local admins group isn't the same as it used to be. Try using the local admin account, then try the other admin account with UAC either off or set to elevate automatically.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Henriques) and 2516 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.131 seconds in which 0.105 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org