RCWM icon indicating copy to clipboard operation
RCWM copied to clipboard

UNC Paths are an issue

Open Dilogoat opened this issue 2 years ago • 3 comments

Excellent suite of tools - very very helpful for my general day to day.

Query though - When moving a local to UNC or UNC to UNC the command window states that it doesn not support UNC paths. I have my own Robocopy script that i have been using for years to move from local to UNC or UNC to UNC depending on use case. I cannot see any material difference in how the Robopcopy command functions but it always moves the folder to C:\Windows$folder.

My own script is this:

@ECHO OFF :: Source input SET /p "src=Please enter source: " SET "casep=%SRC%"

:: SET "casef=%casep:~0,-1%" (IF ENDS IN ) for %%f in (%casep%) do set myfolder=%%~nxf

:: Destination input SET /p dest=Please enter destination: SET dests=%dest:"=% SET "dests=%dests%%myfolder%" MKDIR "%dests%"

:: LOG Directory ECHO LOG will go to root of destination. ECHO Press any key to continue ECHO ========================== pause :: MOVE Command c:\windows\system32\robocopy.exe %src% "%dests%" /MOVE /E /MT:8 /R:1 /W:5 /COPY:da /TEE /NP /LOG:"%dests%\MOVELog.log"

:: Check source folder is empty before removing it DIR /b /a %SRC% | >nul findstr "^" && (echo Files and/or Folders exist) || (echo No File or Folder found) pause

Dilogoat avatar Jun 24 '22 11:06 Dilogoat

Hey, thanks for opening this issue and your feedback!

If I understand correctly, my script copies the folder to your local C:\Windows instead of the actual UNC path? I'll have to test it, it could be the backslashes that are causing the problem. Are you using single or multiple mode? Which windows (or powershell) version? Which RCWM version?

I'm in the process of moving everything to powershell and using registry for storing filepaths, so single mode and multiple mode will both use the same script. Should be a bit easier to debug and maintain.

GChuf avatar Jun 25 '22 08:06 GChuf

Correct, C:\Windows[folder]. The above script I shared with you appears to effectively run it the same way and it works when I run it. PS would be a nice move as well. Thanks for looking into it.

Dilogoat avatar Jun 25 '22 10:06 Dilogoat

I was able to reproduce, this should be fixed when the scripts move to powershell. Since batch script can't "cd" into the UNC path, it can't get the name of the source folder - it mistakenly takes the destination folder's name instead.

GChuf avatar Jun 26 '22 12:06 GChuf

This should be resolved for copying/moving and removing directories in v2.0.0 (making links will still fail). Try it out: https://github.com/GChuf/RCWM/releases/tag/v2.0.0

GChuf avatar Mar 26 '23 16:03 GChuf

Excellent! Giving it a shot now.

On Sun, 26 Mar 2023 at 17:53, Chuf @.***> wrote:

This should be resolved for copying/moving and removing directories in v2.0.0 (making links will still fail). Try it out: https://github.com/GChuf/RCWM/releases/tag/v2.0.0

— Reply to this email directly, view it on GitHub https://github.com/GChuf/RCWM/issues/9#issuecomment-1484156201, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANAYYRBNE443A4345KDT4O3W6B7B3ANCNFSM5ZXSINVA . You are receiving this because you authored the thread.Message ID: @.***>

-- Regards,

Jonathan Flood

Dilogoat avatar Mar 27 '23 13:03 Dilogoat