Windows Command Line – How to Create an Empty File

command linewindows

What is the best way to create an empty file from the command line in windows?

I have been using the touch command but it isn't in stock windows.

One idea was to use echo . >file that works, but the file is never really empty that way. Is there a way to generate an empty file similar to what touch file would do using only what comes with stock windows.

Best Answer

From this answer on Stack Overflow

type nul >file
Related Question