Easy there.  Before we start using the 'V' word, lets just step back for a second.  
First of all, there is absolutely nothing wrong with putting a program in the Run key, 
and it is in fact a bad idea to tell people to categorically delete anything in that 
key.  I would agree that viruses and other programs often use this key, and it is a 
good idea to familiarize yourself with the legitimate contents of this key.  Creaing a 
service for any program that needs to run at startup is overkill, and actually can be 
counterproductive, since the majority of non-OS programs should be run in the user 
context instead of the system context, but this is really a discussion for another 
forum.

Now on to the actual question:

I'm going to assume that the OP has already done his research for now and knows for 
sure that he wants to delete the key in quesion, and avoid the standard lecture on why 
you should be VERY SURE that you want to do this before you start deleting keys.  The 
way you would actually do this would be via a line like this:

my $result = delete $Registry->{'HKEY_LOCAL_MACHINE/SOFTWARE/Tim/MyKey/'};

Of course, this only works if there are no subkeys, so you will have to work your way 
back from the deepest key if there are subkeys.

Also, I really recommend reading the documentation on the module.

"Perldoc Win32::TieRegistry"

-----Original Message-----
From: R. Joseph Newton [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 1:24 PM
To: Tim Johnson
Cc: Jeff Westman; perl_help
Subject: Re: Win32 Registry


Tim Johnson wrote:

> Win32::TieRegistry will do what you want.
>
> use Win32::TieRegistry (delimiter => '/');
> my $run = 
> $Registry->{'HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Run'};
> $run->{'MyApp'} = "My Application";
>
> etc., etc.

That looks like a good example of the crap that we need to scour from our registries.  
Please
don't recommend virus-like program behaviors.  A well-managed Windows machine should 
have
nothing--zilch--nada--in this key.  

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to