Need a DOS Script to Create Files.

September 6, 2010 at 02:19:23
Specs: Windows XP
I have a list of file names in a text file-FilesList.txt, which contains only one column with file names. For example,
File Two.pdf
The Third File.xls
FilesList.txt is stored in the same location that contains the files listed in the file. It is typically created using dir /b > FilesList.txt command.
I am looking for a script (DOS Batch File), which would read the file names from FilesList.txt file and create these files at any selected location. That would mean that I would only have the files with similar names created elsewhere, but these would be blank files.

Any help on this would be highly appreciated.

See More: Need a DOS Script to Create Files.

Report •

September 6, 2010 at 08:48:35
@echo off & setLocal EnableDELAYedeXpansion

set dest=d:\some\where

for /f "tokens=* delims= " %%a in (FilesList.txt) do (
type nul > "!dest!\%%a"

Helping others achieve escape felicity


Report •

September 7, 2010 at 05:04:56
Thanks M2,
It did work for me :)

Report •
Related Solutions

Ask Question