in reply to Re^3: perl robocopy to temp mapped drive.
in thread perl robocopy to temp mapped drive.
Returns:sub netUse { my @net_use_output; my $output; chomp $_[0]; $_ = $1 if($_[0]=~/(.*)\\$/); print "\nnet use \* \"$_[0]\""; #my $output = `net use \* \"$_[0]\" 2>&1|`; open TASK, "net use \* \"$_[0]\" 2>&1|" or die "cannot map $_[0]" +; while (<TASK>) { print "\n"; print; #chomp; #chop; push (@net_use_output, $_); #return $_; } print join(", ", @net_use_output); print "\n"; print "\n"; print "-----\n"; print @net_use_output[0]; $output = $2 if(@net_use_output[0]=~/^(Drive\s)([A-Z])\:(.*)$/); print "\n"; print "\n"; print "-----\n"; print $output; #return @net_use_output; }
net use * "\\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOWN +\DEEP" Drive S: is now connected to \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHA +RS\SHARE\NAME\DOWN\DEEP. The command completed successfully. Drive S: is now connected to \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHA +RS\SHARE\NAME\DOWN\DEEP. , , The command completed successfully. , ----- Drive S: is now connected to \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHA +RS\SHARE\NAME\DOWN\DEEP. ----- S
|
|---|