blackadder has asked for the wisdom of the Perl Monks concerning the following question:
Thanks in advance for your help#! c:/perl/bin/perl.exe -slw use strict; use Win32::Service; use Win32::Registry; use vars qw/%data @source @target/; if ($HKEY_LOCAL_MACHINE->Connect($ARGV[0], my $root)) { print "\nSuccessfully connect to remote registry on $ARGV[0]\n"; if ($root->Open("SYSTEM\\CurrentControlSet\\Control\\Print\\printer +s", my $Key)) { print "Obtaining printer information....Please wait\n"; my @keys; my $counter = 0; $Key->GetKeys( \@keys ); print "\nPrinters found on machine : $ARGV[0]\n"; for my $subkey ( @keys ) { next unless ($subkey =~/,,Winxpps01/); print "Deleting : $subkey\n"; $Key->DeleteKey($subkey); # Please F Off and go away. } $Key->Close; } $root->Close; } else { print "\nError: $^E \n"; }
Still to no avail....can some pleae help?use strict; use Win32::Registry; use vars qw/%data @source @target/; if ($HKEY_LOCAL_MACHINE->Connect($ARGV[0], my $root)) { print "\nSuccessfully connect to remote registry on $ARGV[0]\n"; if ($root->Open("SYSTEM\\CurrentControlSet\\Control\\Print\\printer +s", my $Key)) { print "Obtaining printer information....Please wait\n"; my @keys; my $counter = 0; $Key->GetKeys( \@keys ); for my $subkey ( @keys ) { next unless ($subkey =~/,,Winxpps01/); print "$subkey\n"; $Key->Open( $subkey, my $x ) or die $^E; my %vals; $x->GetValues( \%vals ); for my $item (values %vals) { print "$item\n"; $x->DeleteValue( $item); } $Key->DeleteKey($subkey); } $Key->Close; } } else { print "\nError: $^E \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How can I delete Win32 registry keys?
by pg (Canon) on Oct 17, 2004 at 20:42 UTC | |
| |
|
Re: How can I delete Win32 registry keys? (pointer)
by tye (Sage) on Oct 18, 2004 at 05:31 UTC | |
by blackadder (Hermit) on Oct 21, 2004 at 10:48 UTC | |
|
Re: How can I delete Win32 registry keys?
by talexb (Chancellor) on Oct 18, 2004 at 02:55 UTC |