Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty files 1

Status
Not open for further replies.

TrevJones

Programmer
Nov 20, 2000
37
GB
Does anyone know of a way to create an empty file from the command line or a batch file?
 
. > c:\test.txt

This line in a batch file will display an error in the dos window but will not terminate the batch file and leaves an empty file created (at least in 2000, should be the same for NT though).
 
Thanks very much - it did work for NT.

What I have done in the end is use somthing very similar

@echo Creating file name.txt 2> c:\name.txt

Because there are no errors from the echo statement none are directed (through '2>' ) to the new file which is created anyway.

Thanks for pointing the way
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top