in reply to perl robocopy to temp mapped drive.

Are you sure Robocopy does not work with the full unc path? I mean, just doing some googling here and I find topics that are related to your error on multiple forums and suggestions on how to overcome this.

Examples of what I find: Using the flags /COPY:DT /DCOPY:T here or not using the /COPYALL flag here or using /FFT flag here. So maybe you can also show us the Robocopy command line instructions that you tried to use?

If all not works, regards to mapping a drive you may also be interested in Win32::FileOp which seems to have a nice Map instruction.

Hope it helps, Veltro

Replies are listed 'Best First'.
Re^2: perl robocopy to temp mapped drive.
by 3dbc (Monk) on Oct 11, 2018 at 15:59 UTC
    I have some modules, not sure if I've got win32::FileOp, I'll check next.
    d:\>net use \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOW +N\DEEP Local name Remote name \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NA +ME\DOWN\DEEP Resource type Disk Status Disconnected # Opens 0 # Connections 4 The command completed successfully. d:\>ROBOCOPY "C:\Users\test\AppData\Local\Temp" "\\BLAH\NESTED\OBFUSCA +TED.WITH SPECIAL_CHARS\SHARE\NAME\DOWN\DEEP" crap.csv /B ---------------------------------------------------------------------- +--------- ROBOCOPY :: Robust File Copy for Windows ---------------------------------------------------------------------- +--------- Started : Thu Oct 11 11:51:58 2018 2018/10/11 11:51:58 ERROR 5 (0x00000005) Getting File System Type of D +estination \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOWN\DEEP\ Access is denied. Source : C:\Users\test\AppData\Local\Temp\ Dest - \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOW +N\DEEP\ Files : crap.csv Options : /COPY:DAT /B /R:1000000 /W:30 ---------------------------------------------------------------------- +-------- 1 C:\Users\test\AppData\Local\Temp \ 100% Newer 2.2 m crap.csv ---------------------------------------------------------------------- +-------- Total Copied Skipped Mismatch FAILED Extras Dirs : 1 0 1 0 0 0 Files : 1 1 0 0 0 0 Bytes : 2.23 m 2.23 m 0 0 0 0 Times : 0:00:01 0:00:01 0:00:00 0:00:00 Speed : 1469544 Bytes/sec. Speed : 84.088 MegaBytes/min. Ended : Thu Oct 11 11:52:00 2018
    Thanks,
    - 3dbc
      Just had an error with robocopy using the /B flag and had to change it to the /z flag because of these errors when trying to copy to the mapped unc path (with drive letter).
      net use * "\\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHARS\SHARE\NAME\DOWN +\DEEP" ----- Drive Z: is now connected to \\BLAH\NESTED\OBFUSCATED.WITH SPECIAL_CHA +RS\SHARE\NAME\DOWN\DEEP. ROBOCOPY "C:\Users\SERVICE_ACCOUNT~1\AppData\Local\Temp" Z:\ Crap.csv +/B ---------------------------------------------------------------------- +--------- ROBOCOPY :: Robust File Copy for Windows + ---------------------------------------------------------------------- +--------- Started : Fri Oct 12 11:12:23 2018 Source : C:\Users\SERVICE_ACCOUNT~1\AppData\Local\Temp\ Dest : Z:\ Files : Crap.csv Options : /COPY:DAT /B /R:1000000 /W:30 ---------------------------------------------------------------------- +-------- ERROR : You do not have the Backup and Restore Files user rights. ***** You need these to perform Backup copies (/B or /ZB). ERROR : Robocopy ran out of memory, exiting. ERROR : Invalid Parameter #%d : "%s" ERROR : Invalid Job File, Line #%d :"%s" Started : %hs Source %c Dest %c Simple Usage :: ROBOCOPY source destination /MIR source :: Source Directory (drive:\path or \\server\share +\path). destination :: Destination Dir (drive:\path or \\server\share +\path). /MIR :: Mirror a complete directory tree. For more usage information run ROBOCOPY /? **** /MIR can DELETE files as well as copy them ! net use Z:\ /delete Z: was deleted successfully.
      - 3dbc