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
cmd
in the Start menu or by pressingWin + R
, typingcmd
, and pressingEnter
. - Use the
xcopy
command with the/T /E
options. The/T
option copies the directory structure (but not the files) and the/E
option includes empty directories. Here’s an example:
xcopy "source_directory" "destination_directory" /T /E
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:
xcopy "C:\Users\YourName\Documents" "D:\Backup" /T /E
This will create a copy of the Documents
directory structure in the Backup
directory, but it won’t copy any files.