Hi - very sorry and many thanks.

here what I have now;
use strict; use Win32::Registry; use vars qw/%data @source @target @missing/; 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", my $Ke +y)) { print "Obtaining printer information....Please wait\n"; my @keys; $Key->GetKeys( \@keys ); print "\nListing printers found on source machine\n"; print "\n------------------------------------------------------- +------\n"; for my $subkey ( @keys ) { print "\n\nSubKey : $subkey\n"; $Key->Open( $subkey, my $x ) or die $^E; my %vals; my @vals; $x->GetKeys( \@vals ); for my $item (@vals) { next if ($item !~ /^,,My_print_server01/); print "Items within : $item\n"; regDelTree($item, "HKEY_LOCAL_MACHINE\\System\\CurrentCont +rolSet\\Control\\Print\\Printers\\") } } $Key->Close; } } else { die"FATAL ERROR : NO SOURCE MACHINE $ARGV[0], $^E\n"; } sub regDelTree { my $rootKey= shift @_; # Reg key to del subtree from my $keyName= shift @_; # Name of key to delete { my $key= $rootKey->{$keyName}; if( ! $key ) { warn "Can't open $keyName in ", $rootKey->Path(), ": $^E\n"; return; } for( $key->SubKeyNames() ) { regDelTree( $key, "$_\\" ); } } delete $rootKey->{$keyName} or warn "Can't delete $keyName from ", $rootKey->Path(), ": $^E\n"; }
And I get this error
C:\Perl>comp_apps1.pl Remote_WorkStation01 Successfully connect to remote registry on Remote_WorkStation01 Obtaining printer information....Please wait Listing printers found on source machine ------------------------------------------------------------- SubKey : Environments SubKey : Forms SubKey : Monitors SubKey : PendingUpgrades SubKey : Providers SubKey : Printers Items within : ,,My_print_server01,Printer_device200 Can't use string (",,My_print_server01,Printer_device200") as a HASH r +ef while "strict refs" in use at C:\Perl\comp_apps1.pl line 40. C:\Perl>
Any Advise Please?,....Many thanks in advance.

Regards
Blackadder

In reply to Re^2: How can I delete Win32 registry keys? (pointer) by blackadder
in thread How can I delete Win32 registry keys? by blackadder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.