in reply to Re^2: perl robocopy to temp mapped drive.
in thread perl robocopy to temp mapped drive.
Try adding pipe to open
open TASK, '-|',"net use \* \"$_[0]\"" or die "cannot map $_[0]";or alternatively
poj#!perl use strict; use warnings; use IPC::System::Simple qw/capture/; my $destination = "\\\\BLAH\\NESTED\\OBFUSCATED\.WITH SPECIAL_CHARS\\S +HARE\\NAME\\DOWN\\DEEP"; print netUse($destination); sub netUse { my $path = shift; my $cmd = "net use * $path"; my ($msg) = grep /Drive/, capture($cmd); return ($msg =~ /Drive (.*) is now connected/); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: perl robocopy to temp mapped drive.
by 3dbc (Monk) on Oct 11, 2018 at 17:53 UTC |