Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Changing Registry Values

by akm2 (Scribe)
on Jul 31, 2002 at 14:02 UTC ( [id://186493]=perlquestion: print w/replies, xml ) Need Help??

akm2 has asked for the wisdom of the Perl Monks concerning the following question:

I need to modify the value of HKEY_CURRENT_USER\Software\Microsoft\WAB\WAB4\Wab File Name in my WinXP PRO registry. I have written the following script:

$key = 'HKEY_CURRENT_USER\Software\Microsoft\WAB\WAB4\Wab'; #use Win32::TieRegistry; use Win32::TieRegistry ( Delimiter=>"/" ); $wabPath = $Registry->{$key};

The above code seems to get the current value of the key and store it in $wabPath exactly as desired. However, I can't seem to figure how to change the key value in the registry.

Any pointers?

Andrew Kenton Mitchell
Andrew@AndrewKMitchell.com

Replies are listed 'Best First'.
Re: Changing Registry Values
by Dog and Pony (Priest) on Jul 31, 2002 at 14:09 UTC
    I think this would work?
    $Registry->{$key} = $newWabPath;

    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: Changing Registry Values
by BronzeWing (Monk) on Jul 31, 2002 at 16:31 UTC
    According to the man page for Win32::TieRegistry (here), you should be able to do something as simple as this:

    $Registry->{$key} = 'foo';

    You might want to check your rights to that key too, since you're running under Windows XP. Also, try using 'CUser' instead of 'HKEY_CURRENT_USER' for the root key, there's something in the man page about that too.

    The Secret to Fortune Cookies in One Line
    print join("... in bed", `fortune fortunes` =~ m/^(.*)(\.|\?|\!)$/), "\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://186493]
Approved by newrisedesigns
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-16 04:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found