I have a big Windows directory and file tree. Now I need to copy this tree to another location but I do not want to copy the contents from each file. Only the structure and filenames with 0 bytes contents are needed. How could this be done with as cmd shell in Windows 10?
What I did:
xcopy /t e:\oldtreedir e:\new\oldtreedir
dir /a /b /s > mybat.bat
edit mybat.bat to:
replace \ne:\ to
\ncopy nul e:\new\
so that it is for each filename the line
copy nul e:\new\oldtreedir\file1.txt
I had to edit the mybat.bat. Could this be done by a script in the Windows command line?
PS: I found this: WIN-PRg but this program do not create a dir-tree. All files are in one dir only.
If I got your question right, robocopy
should do the trick:
robocopy "E:\oldtreedir" "E:\new\oldtreedir" "*.*" /E /CREATE