[英]How to delete files and folders but keep directory structure and leave behind a empty file instead of file itself?
[英]Replicate a directory file structure with empty files
我有一個具有這種結構的目錄(實際用例:數千個文件,400GB目錄!):
mydir/
|---- blabla.mp4 3.2 GB
|---- foo/
|----- blup/
|----- test.wav 245 MB
|----- test.txt 12 KB
|---- xyz/
|----- test2.txt 10 KB
|---- zzz.wav 100 MB
如何使用Windows復制樹結構+文件名結構並獲得它?
mydir_structure/
|---- blabla.mp4 0.0 KB
|---- foo/
|----- blup/
|----- test.wav 0.0 KB
|----- test.txt 0.0 KB
|---- xyz/
|----- test2.txt 0.0 KB
|---- zzz.wav 0.0 KB
從Windows Vista中,操作系統中包含了robocopy
(對於以前的版本,可以從Microsoft下載)
robocopy \mydir \mydir_structure /create /e
/e
表示包括空文件夾的遞歸副本。
/create
在目標層次結構中創建空文件。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.