freelanceprogrammers.org Forum Index » Perl
Help with creating registry keys.
Joined: 19 Jul 2004
Posts: 4
Help with creating registry keys.
Hello,
I`m a NetAdmin and I use Perl to automate various tasks. I am
currently trying to get it to create registry keys so I can push out
an update, but I keep getting an error that`s confusing me. Here`s
the error and a short script I wrote as a test.
ERROR:
Modification of a read-only value attempted at
C:/perl/site/lib/Win32/Registry.pm line 228.
SCRIPT:
use Win32::Registry;
$HKEY_LOCAL_MACHINE->Open($root, "SOFTWARE\cj");
#I manually created the cj key in regedit.
$root->Create($newkey, "testkey");
$root->Close;
Joined: 19 Jul 2004
Posts: 4
Help with creating registry keys.
I solved my own problem. I had the variables backwards!
The create line should have been:
$root->Create("testkey", $newkey);
FYI...
Chris
--- In perl_official@yahoogroups.com, "Chris" <chrisj01@s...> wrote:
> Hello,
>
> I`m a NetAdmin and I use Perl to automate various tasks. I am
> currently trying to get it to create registry keys so I can push out
> an update, but I keep getting an error that`s confusing me. Here`s
> the error and a short script I wrote as a test.
>
> ERROR:
> Modification of a read-only value attempted at
> C:/perl/site/lib/Win32/Registry.pm line 228.
>
> SCRIPT:
> use Win32::Registry;
> $HKEY_LOCAL_MACHINE->Open($root, "SOFTWARE\cj");
> #I manually created the cj key in regedit.
> $root->Create($newkey, "testkey");
> $root->Close;
All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help
China Wholesale - Electronics Products
Character Studio - Tutorials and Help







