How to: Copy multiple filenames & extensions, creating empty files

tid433

Commendable
Apr 23, 2016
3
0
1,510
Windows 7

Problem:
Copy multiple filenames and their extensions to create empty multiple files of the same name.
 
Solution
You can use robocopy for this. E.g. in PowerShell (all one one line as single command):

Code:
PS C:\Users\Username> robocopy "C:\Users\Username\Documents" "D:\EmptyFileLocation" -s -create

-s makes robocopy recursively add subdirectories, omitting empty ones
-e would do the same, except it includes empty subdirectories
-create creates zero-length files instead of copying existing ones

Gillerer

Distinguished
Sep 23, 2013
366
86
18,940
You can use robocopy for this. E.g. in PowerShell (all one one line as single command):

Code:
PS C:\Users\Username> robocopy "C:\Users\Username\Documents" "D:\EmptyFileLocation" -s -create

-s makes robocopy recursively add subdirectories, omitting empty ones
-e would do the same, except it includes empty subdirectories
-create creates zero-length files instead of copying existing ones
 
Solution