Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: access 64bit registry from 32 bit Perl

by bulk88 (Priest)
on Dec 06, 2012 at 04:08 UTC ( #1007454=note: print w/replies, xml ) Need Help??

in reply to Re^2: access 64bit registry from 32 bit Perl
in thread access 64bit registry from 32 bit Perl

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>

Replies are listed 'Best First'.
Re^4: access 64bit registry from 32 bit Perl
by anaconda_wly (Scribe) on Dec 06, 2012 at 06:46 UTC
    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!
Re^4: access 64bit registry from 32 bit Perl
by anaconda_wly (Scribe) on Dec 07, 2012 at 11:13 UTC

    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

      You could always use

      psexec -? -accepteula /accepteula 1>NUL 2>NUL

      psexec.exe -d -l -u username -p password myfoo.bat

      -d Don't wait for process to terminate (non-interactive). -l Run process as limited user (strips the Administrators grou +p and allows only privileges assigned to the Users group). On Windows Vista the process runs with Low Integrity.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007454]
[atcroft]: james28909: What about October 5, 1582?
[stevieb]: atcroft: "Make both hands into fists..."... is something my Ma taught me in our native lang, but I was to ignorant and young to pay attention. Thanks for that :)
[atcroft]: stevieb: Sad to say that I only recently learned that particular trick, but I have since found it very useful.... :)
[james28909]: ill be back with a solution eventually
[stevieb]: it's a reminder to re-inforce it :P
[atcroft]: james28909: That particular questions was a bit of trick, actually (depending on the country you are in). More interesting is, if you are trying to subtract from an epoch time, for instance, you might have to consider when/if DST occurs for a location,
[atcroft]: because you may have to adjust the number of seconds you change from an epoch from 86400 (not to mention leap seconds)....
[atcroft]: james28909: Although if your program is using a database, you might be able to "pass the buck" to the database and ask it to do the date change for you....

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2017-04-29 04:35 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (531 votes). Check out past polls.