I'm working on part of a backup batch script that moves between two directories on the same drive. I was using Robocopy (with /MOVE switch), but want to speed up the file transfer. As such, I'm trying to implement MOVE. It has worked in one part of my script, but in my C: drive I am getting a weird error.
Here's a sample of a test script in a test folder, that comes up with the same error that I'm getting in the main batch (trying to isolate errors):
set thisdirectory=%cd%
cd ..
MOVE "%thisdirectory%" "C:\Documents\DEL\Stephen Company\"
I have tried that with/without the /Y switch, with all paths hard-coded (no vars), and with "\" added and removed from the end of the source/destination paths.
What happens is that the folder (thisdirectory) does indeed move, but the script won't continue to execute because I get this error:
C:\Documents\Active\Stephen Company>MOVE "C:\Documents\Active\Stephen Company\C123Stephen" "C:\Documents\DEL\Stephen Company\"
1 dir(s) moved.
The system cannot find the path specified.
I am an "Authenticated User" on this account, but not an Administrator. If I run it in CMD Prompt without a batch script it works:
C:\Documents\Active\Stephen Company>MOVE "C123Stephen" "C:\Documents\Del\Stephen Company"
1 dir(s) moved.
This also works with full paths (not using the fact I'm 1 dir above to move it):
C:\Documents\Active\Stephen Company>MOVE "C:\Documents\Active\Stephen Company\C123Stephen" "C:\Documents\Del\Stephen Company"
1 dir(s) moved.
Any ideas how I'm messing this up? Thanks!!
NEW INFO: this may be obvious per the format of the error message I have posted to those (all?) of you with more CMD/Batch experience, but when I send the output of my MOVE command to a text file in the batch code above (> MoveOutput.txt) I only see "1 dir(s) moved". The error that is messing me up (The system cannot find the path specified) directly follows the execution of the MOVE command. NOTE nothing follows the MOVE command in my script that I am getting the error in.