You can use the robocopy command in Windows Command Prompt to copy folders and subfolders without copying files. Here’s how you can do it:
- Open Command Prompt. You can do this by searching for
cmdin the Start menu or by pressingWin + R, typingcmd, and pressingEnter. - Use the
robocopycommand with the/Eand/XF *options. The/Eoption copies all subdirectories (including empty ones) and the/XF *option excludes all files. Here’s an example:
robocopy "source_directory" "destination_directory" /E /XF *Replace source_directory with the path of the directory you want to copy and destination_directory with the path where you want to copy the directory to.
For example, if you want to copy the directory structure of C:\Users\YourName\Documents to D:\Backup, you would use the following command:
robocopy "C:\Users\YourName\Documents" "D:\Backup" /E /XF *This will create a copy of the Documents directory structure (including all subfolders) in the Backup directory, but it won’t copy any files.