Jan Dubois wrote:
> On Wed, 21 Dec 2005, Anthony Okusanya wrote:
>
>>Hi all I have a utility I wrote using ActivePerl. It is used to
>>install applications and hotfixes on Windows servers. I am trying to
>>modify this to work with the 64bit version of Windows 2003. The
>>problem is that due to the registry re-direction that 64it uses to
>>maintain 32bit compatibility, my script is not reading the registry
>>keys properly.
>
>
> You could try working around the registry redirection by using Windows
> Scripting Host. I haven't tried this, but it is likely that those will
> be 64 bit components and run outside the WOW64 subsystem.
>
> Here is some minimal sample to read a value (use some other key, as the
> default value for "HotFix" is normally not set):
>
> use Win32::OLE;
> my $shell = Win32::OLE->new("WScript.Shell");
> print $shell->RegRead('HKLM\\SOFTWARE\\Microsoft\\Windows
> NT\\CurrentVersion\\HotFix\\');
This works for 32 bit:
use Win32::OLE;
my $shell = Win32::OLE->new("WScript.Shell");
my $ret = $shell->RegRead("HKLM\\SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\Hotfix\\KB896424\\Installed") or warn "RegRead: " .
Win32::OLE->LastError();
print "$ret\n";
Wouldn't work until I took it down to the Installed subkey.
> You do have to use backslashes in the keyname. Run with `perl -w` to get
> all error messages if something goes wrong.
>
> Here is a link to the RegRead() documentation:
>
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/af4423b2-4ee8-41d6-a704-49926cd4d2e8.asp
>
> Please report back if this works around the problem or not.
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs