I'm trying to use Robocopy in a way that excludes all subfolders under a chosen folder. In other words, I only want to target a folder and robocopy only the files within it but not it's subfolders. Is there a way to do so?
How to use Robocopy to exclude ALL subfolders under a chosen folder
robocopy
Related Topic
- Exclude only some files with the same name when copying using robocopy
- How to use robocopy with a large number of excluded files
- Windows – How to exclude files in a folder with pattern with robocopy
- Robocopy – Exclude specific file from purge within subdirectory
- RoboCopy not copying all files and folders
- Windows – Use robocopy to only copy files not folders
Best Answer
Excluding subfolders is actually the default behavior of robocopy, or at least the version that comes with Windows 7. (In order to copy the sub-directories you would have to add the
/S
or/E
option to the command.)So, you can just use
robocopy source-folder target-folder
.