RayRay459 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to set the administrator account on a remote machine. I am using Win32::AdminMisc and i am not getting the desired results. Can anyone help. Or anyone know of another way to do this. (This is my first time using the module). Here's what i have so far...
# Ray Espinoza # ChangePass.pl # This script will attempt to change the local admin password on a mac +hine. ###################################################################### +############# #!D:\perl\bin -w use Win32::AdminMisc; $Server = "\\muskrat"; $UserName = "Administrator"; $UserFullName = "Administrator"; $Password = "testing"; $PasswordAge = 0; $Privilege = "USER_PRIV_USER"; $HomeDir = "C:/winnt"; $Comment = 0; $Flags = 0; $ScriptPath = "C:/scripts/perl/changepass.pl"; Win32::AdminMisc::UserSetAttributes( $Server, $UserName, $UserFullName +, $Password, $PasswordAge, $Privilege, $HomeDir, $Comment, $Flags, $S +criptPath ) || die "Couldn't set the attributes: $!";

Replies are listed 'Best First'.
Re: setting password on remote machine
by joefission (Monk) on Aug 10, 2001 at 04:22 UTC
    You need 4 backslashes, since they are escaped within double quotes.

    $Server = "\\\\muskrat";

      They are escaped in single quotes, qw, qq, and a slew of others. Is there any way to turn this off? Just curious.
        Not if you ever want to use the string delimiter in the string:

        my $example = 'don\'t try this at home';