http://www.perlmonks.org?node_id=1007178


in reply to access 64bit registry from 32 bit Perl

Google says you need to call the 64 bit version of regedit. You are calling the 32 bit version probably.
  • Comment on Re: access 64bit registry from 32 bit Perl

Replies are listed 'Best First'.
Re^2: access 64bit registry from 32 bit Perl
by anaconda_wly (Scribe) on Dec 06, 2012 at 03:19 UTC
    I can't find "windows/sysnative" folder on both my win7 and win2k3(64bit). I only see "sysWOW64" in Winodws folder.
      goto C:\WINDOWS\SysWOW64 in explorer, double click on cmd.exe,
      Microsoft Windows [Version 5.2.3790] (C) Copyright 1985-2003 Microsoft Corp. C:\WINDOWS\SysWOW64>cd .. C:\WINDOWS>cd Sysnative C:\WINDOWS\Sysnative>
      Only 32 bit processes can see it. It doesn't exist in a 64 bit process. Server 2003 x64 used for above example (I did apply the MS patch to enable sysnative on server 2003 btw). If I try a normal (64 bit) cmd.exe I get
      C:\WINDOWS>cd Sysnative The system cannot find the path specified. C:\WINDOWS>

        thanks ! The following did the magic for me : system("\"%systemroot%\\sysnative\\reg\" query HKLM\\software\\galil /s")

        Yes, you're right. I add the absolute path to my code and get what I want. The Sysnative only visible by 32bit cmd.exe. Thank you!

        Bulk88: I still got a problem if you can see it. the regedt32.exe seems must run using run as administrator in Win7. So it comes a problem when I want to run it quietly without any manual interference. What I can think is using runas before it. but runas didn't support password...I don't know how to do then...could u help me? or I had to create a new thread

Re^2: access 64bit registry from 32 bit Perl
by anaconda_wly (Scribe) on Dec 05, 2012 at 07:19 UTC
    I had run the two versions of regedit on command line. I found the 32bit regedit.exe didn't contain "Wow6432Node" at all, the 64 bit version provide that node. As my program export always "Wow6432Node" node into the .reg file, I don't think what I called is a 32 bit version.
      I dont understand what you want to do. You have a .reg file, that needs to be applied, without redirection, to the registry? Then use the 64bit regedit. If your .reg file is getting the redirection, then you are calling the 32 bit regedit. You have to use an absolute path with "Sysnative" folder (google it) in it to reach the 64 bit regedit from a 32 bit perl.
        OK, I googled and understand your meaning. But strange my Win7 didn't got a Sysnative folder, I only see system32 and sysWOW64.