You can copy only folders (without files) in Windows using the xcopy command in the Command Prompt. 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
xcopycommand with the/T /Eoptions. The/Toption copies the directory structure (but not the files) and the/Eoption includes empty directories. Here’s an example:
xcopy "source_directory" "destination_directory" /T /EReplace 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:
xcopy "C:\Users\YourName\Documents" "D:\Backup" /T /EThis will create a copy of the Documents directory structure in the Backup directory, but it won’t copy any files.