I want to move all the files and folders inside the folder "C:\Foldertest\" into the folder "C:\Foldertest\target".
And whenever I run this command, it does this for all files and folders except for the "C:\Foldertest\target" folder.
61 Answer
RoboCopy would be the preferred method:
Robocopy C:\FolderTest\ c:\FolderTest\Target /E /ZB /MOVE /MOT:60- Note the trailing backslash in the source folder
- Failing to include this would copy
C:\FolderTest, rather than it's contents
- Failing to include this would copy
/E: Copy subdirectories, including empty ones/ZB: Use restartable mode; if access denied use backup mode- Requires user to be added to Backup Operators group, else change to
/Z
- Requires user to be added to Backup Operators group, else change to
/MOVE: Move files and dirs (delete from source after copying)/MOT: Monitor source; run again in X minutes, if changed- You could also utilize
/MON:1/MON: Monitor source; run again when more than X changes seen
- You could also utilize