How to Create Empty Files from the Windows Command Prompt

Files that have names and positions in a file system but lack any actual content are called empty or zero-byte files. There are several reasons that you might want to create these. Certain pieces of software require the presence of an empty file in order to turn on an alternative option, such as the ability to run in a portable environment. It might also be advantageous to create placeholders that will be filled later on.

POSIX-compatible systems have the touch command, but Windows administrators don’t have access to this. Creating files with Notepad or some other basic part of Windows or Windows Server isn’t ideal, but there is a way to accomplish this from the command prompt. You can copy data from the NUL device, which is a location called the bit bucket that simply doesn’t exist, in order to create empty content.

Creating Empty Files

Hold the Windows Key and Press R. Type cmd in the box that comes up and press Enter. Navigate to the directory that you wanted to place the files in by typing:

cd “C:\Example Directory”

Replace Example Directory with the folder you actually need to work from, and make sure the path is in quotation marks. Then type:

copy nul “emptyfile.txt”

2016-09-25_101509

Replace emptyfile.txt with the name of the file you need. This can be repeated as many times as needed.

Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Expert Tip

How to Create Empty Files from the Windows Command Prompt

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested