Leser: 27
system ('net use w: \\\\' .$qs_srv_adr. '\\E$ $pwd /user:$user') or die $!;
1 2 3
my $netuse = 'net use w: \\\\' .$qs_srv_adr. '\\E$ $pwd /user:$user'; print "NETUSE: $netuse\n"; system($netuse);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#! /usr/bin/perl use strict; use warnings; print "Please give IP of server to connect to: "; chomp( my $ip = <STDIN> ); print "Please give share to connect to: "; chomp( my $share = <STDIN> ); my $netuse = sprintf( 'net use W: \\\\%s\\%s', # %s /user:%s', $ip, $share, # $pass, $user ); system( $netuse ) == 0 or die "'$netuse' failed: $!\n"; __END__
my $netuse = 'net use w: \\\\' .$qs_srv_adr. '\\E$ '.$pwd.' /user:'.$user.'';