#! 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\\printers", 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"; }