For some reason this snippet of code isn't removing a directory inside my registry. Directory isn't the right word, but it's the main folder all it's subkeys are in. It is full of other subkeys and subsubkeys and I want to remove the upmost "folder/key" to rid of all of it.
This code produces no error like it originally did when it told me the file could not be found. It prints "done" but when I go back into regedit, the folder/key is still sitting there smiling at me.
#!/usr/bin/perl
use warnings;
use strict;
use Win32::TieRegistry( Delimiter=>"/", ArrayValues=>0 );
my $myway= delete $Registry->{"HKEY_LOCAL_MACHINE/SOFTWARE/MyWay/"};
print "Done";
The key MyWay DOES exist, I checked it a dozen times. The original thought was we couldn't delete keys that had subkeys, but according to the example they use, it sounds like you can"
Deleting a key
WARNING: The following code will delete all information about the curr
+ent user's tip preferences. Actually executing this command would pro
+bably cause the user to see the Welcome screen the next time they log
+ in and may cause more serious problems. This statement is shown as a
+n example only and should not be used when experimenting.
$tips= delete $Registry->{"CUser/Software/Microsoft/Windows/" .
"CurrentVersion/Explorer/Tips/"};
I'm on WinXP for those who are interested. Thank you for your help!
"Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"
sulfericacid
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.