Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Failed to check if registry key is exist

by RMGir (Prior)
on Feb 27, 2012 at 13:17 UTC ( #956442=note: print w/replies, xml ) Need Help??


in reply to Failed to check if registry key is exist

I'd suggest replacing your "" in the line where you're creating $UninstallRegistryPATH with single quotes, so you can just paste in the key name and not have to worry about doubling-up the \'s. Get the key name to paste in using regedit - right click on the key and choose "Copy Key Name".

I don't know if that will fix your issue, but when I do that with a key from my registry in the same subtree (I don't have your particular node installed) in my copy of your script, it works fine.


Mike
  • Comment on Re: Failed to check if registry key is exist

Replies are listed 'Best First'.
Re^2: Failed to check if registry key is exist
by roteme (Acolyte) on Feb 28, 2012 at 06:32 UTC

    I've tried your suggestion with single quotes with no success.

    Can you please share your example with me.

    Thanks.

      my $UninstallRegistryPATH = 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Window\CurrentVersion\Uninstall +\{3C3901C5-3455-3E0A-A214-0B093A5070A6}'; my $cmd = "REG QUERY ${UninstallRegistryPATH}"; print "\n----$cmd----\n\n"; my @RegKeys = `$cmd 2>&1`; foreach my $var (@RegKeys) { print "$var" }
      Result:
      ----REG QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVer +sion\Uninstall\{3C3901C5-3455-3E0A-A214-0B093A5070A6}---- ! REG.EXE VERSION 3.0 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall +\{3C3901C5-3455-3E0A-A214-0B093A5070A6} AuthorizedCDFPrefix REG_SZ Comments REG_SZ Contact REG_SZ DisplayVersion REG_SZ 4.0.30319 HelpLink REG_SZ HelpTelephone REG_SZ InstallDate REG_SZ 20120209 InstallLocation REG_SZ InstallSource REG_SZ C:\313aede3e0764106ff44\ ModifyPath REG_EXPAND_SZ MsiExec.exe /X{3C3901C5-3455-3E0A-A +214-0B093A5070A6} NoModify REG_DWORD 0x1 NoRepair REG_DWORD 0x1 Publisher REG_SZ Microsoft Corporation Readme REG_EXPAND_SZ http://go.microsoft.com/fwlink/?LinkId= +164156 Size REG_DWORD 0x9b34 EstimatedSize REG_DWORD 0x206c7b SystemComponent REG_DWORD 0x1 UninstallString REG_EXPAND_SZ MsiExec.exe /X{3C3901C5-3455-3 +E0A-A214-0B093A5070A6} URLInfoAbout REG_SZ http://go.microsoft.com/fwlink/?LinkId=1 +64164 URLUpdateInfo REG_SZ http://go.microsoft.com/fwlink/?LinkId= +164165 VersionMajor REG_DWORD 0x4 VersionMinor REG_DWORD 0x0 WindowsInstaller REG_DWORD 0x1 Version REG_DWORD 0x400766f Language REG_DWORD 0x0 DisplayName REG_SZ Microsoft .NET Framework 4 Client Profile
      </code>

      Mike

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://956442]
help
Chatterbox?
[erix]: 1=0 is as short as TOP :)
[erix]: "code of someone that died" -- kinda nice if your code stops working too
[erix]: hard to implement, hmm
[Corion]: erix: Well, they also seem to have changed the server, or some software, or whatever, and seem to be in the process of changing the DB schema from having the "username" as primary key to something else.
[Corion]: Far too many things being done at once, or maybe only now has it become apparent that nobody knows that piece of software anymore
[marto]: good morning all
[Corion]: I consider having an abstract key as userid in your system good, because the "real" company-wide (or even larger) user id will likely not fit your criteria well
[Corion]: A good morning marto!

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-01-23 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (192 votes). Check out past polls.