Problem
I'm trying to move a folder (ex. \\myUNC\folder1
) and its contents to another folder (ex. \\myUNC\Parent\folder1
). There are two easy enough ways I'd typically do this - either using move
(similar to here) or using ren
(similar to here).
Example Code
set oldPath=\\myUNC\folder1
set newPath=\\myUNC\Parent\folder1
move "%oldPath%" "%newPath%"
::ren"%oldPath%" "%newPath%"
Troubleshooting
When attempting the move
solution in my first like, I get the error:
The filename or extension is too long. 0 dir(s) moved.
As a result, I tried ren
like in my second link, which gave the error:
The syntax of the command is incorrect.
For this second error, I'm assuming that is because I'm passing the path as part of my variable - which ren
doesn't accept. The batch calling this change is NOT in the same directory as the folder or its new path. As a result I can't use current directory code (like ren
or cd
), at least as far as I know.
If anyone has a possible solution it would be greatly appreciated! Thanks.