In that case, you will not be interested in this version of your code that runs clean under strict and warnings and is now in a form that would make it easy to run the updates 10, or 20 or even 100 machines at a time in parallel.

use strict; use Tk; use TK::Dialog; use Win32::AdminMisc; use Win32::GUI; open (OUTPUT, ">Error.txt"); select(OUTPUT); $| = 1; my $DOS = Win32::GUI::GetPerlWindow(); Win32::GUI::Hide($DOS); my $mw = MainWindow->new; my $c = $mw->Canvas( -width =>582, -height=>450)->pack; my( $CheckRenameAdmin, $CheckAdminPassword, $CheckRenameGuest ); my( $CheckDisableGuest, $server, $AdminPass, $Adminuser, $NewAdminUser + ); $mw->title("Admin Tools"); my $text = $mw->Scrolled( 'Text', -scrollbars => 'seo' )->place(-x => 4, -y => 89); my $lab = $mw->Label( -text => 'Select your choices' )->place(-x => 0, -y => 0); my $quit = $mw->Button( -text => "Quit", -command => \&Quit )->place(-x => 540, -y => 57); my $run = $mw->Button( -text => "Run", -command => \&Exec )->place(-x => 500, -y => 57); my $adminrename = $mw->Checkbutton( -text => "Rename Admin Account", -variable => \$CheckRenameAdmin )->place(-x =>0, -y => 15); my $adminSetPass = $mw->Checkbutton( -text => "Set Admin Password", -variable => \$CheckAdminPassword )->place(-x =>0, -y => 49); my $Guestrename = $mw->Checkbutton( -text => "Rename Guest Account", -variable => \$CheckRenameGuest )->place(-x =>0, -y => 32); my $GuestDisable = $mw->Checkbutton( -text => "Disable Guest Account", -variable => \$CheckDisableGuest )->place(-x =>0, -y => 64); my $Servername = $mw->Entry( -textvariable => \$server )->place(-x => 180, -y => 19 ); my $Adminpass = $mw->Entry( -textvariable => \$AdminPass )->place(-x => 180, -y => 57); my $TextAdminPass = $mw->Label( -text => "New Admin Password:" )->place(-x => 187, -y => 38); my $TextServerName = $mw->Label( -text => "Enter computer or .txt file:" )->place(-x => 180, -y => 0 ); my $OldAdmin = $mw->Entry( -textvariable => \$Adminuser )->place(-x => 360, -y => 19); my $NewAdmin = $mw->Entry( -textvariable => \$NewAdminUser )->place(-x => 360, -y => 57); my $TextAdminUser = $mw->Label( -text => "Enter the Current Admin username:" )->place(-x => 340, -y => 0); my $TextNewAdminUser = $mw->Label( -text => "Enter the New Admin username:" )->place(-x => 340, -y => 38); MainLoop; Win32::GUI::Show($DOS) ; sub Exec { my @computers; if ($server =~ m/txt/) { open(DAT, $server) or die "Could not open file!\n"; @computers=<DAT>; close(DAT); chomp @computers; } else { @computers = $server; } foreach my $computer (@computers) { my $logtext = "$computer\n"; $logtext .= AdminRename( $computer ) if $CheckRenameAdmin +; $logtext .= AdminPasswordSet( $computer ) if $CheckAdminPasswo +rd; $logtext .= GuestRename( $computer ) if $CheckRenameGuest +; $logtext .= GuestDisable( $computer ) if $CheckDisableGues +t; $logtext .= "================================================ +=\n"; print OUTPUT $logtext; $text->insert("end", $logtext ); $text->update; } } sub Quit { my $d = $mw->Dialog( -text => "Are you sure you want to quit?", -buttons => ["Yes", "No"] ); my $answer = $d->Show(); return unless $answer eq 'Yes'; close(OUTPUT); exit; } sub GuestRename { my $server = shift; my $Guestuser = "Guest"; my $NewGuestUser = "DisabledGuestAccount"; return sprintf "The user $Guestuser was %s changed to $NewGuestUse +r\n", Win32::AdminMisc::RenameUser($server, $Guestuser, $NewGuestUse +r) ? '' : 'not'; } sub GuestDisable { my $server = shift; my $NewGuestUser = "DisabledGuestAccount"; return sprintf "The Guest Account has %s been disabled\n", Win32::AdminMisc::UserSetMiscAttributes( $server, $NewGuestUser, USER_FLAGS => UF_ACCOUNTDISABLE | UF_PASSWD_CANT_CHANGE | UF_DONT_EXPIRE_PASSWD ) ? '' : 'not'; } sub AdminRename { my $server = shift; return sprintf "$Adminuser has %s been renamed to $NewAdminUser\n" +, Win32::AdminMisc::RenameUser($server, $Adminuser, $NewAdminUse +r) ? '' : 'not'; } sub AdminPasswordSet { my $server = shift; return sprintf "Admin password has %s been set\n", Win32::AdminMisc::SetPassword($server, $NewAdminUser, $AdminPa +ss) ? '' : 'not' ; }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^3: Increase response time by BrowserUk
in thread Increase response time by SteveS832001

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.