Open In App

How to Create a File in CMD?

Last Updated : 21 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Working on any Windows device is synonymous with working on any certain file on the device. Individual needs to work on different files as well as create new ones on their Laptops or Desktops daily. To create a file on Windows, the File Explorer of Windows is generally used. However, the Windows Command Prompt can be a strong alternative.

In normal cases, an individual goes into the required directory & Creates a New File on Windows using Windows File Explorer. To create a new file in the command prompt, a few commands should be executed which is much effortless. However, only Windows Notepad Files could be created when you opt for Making a File using CMD.

In this article, we will discuss different methods that can be used to Develop a File on Windows using Command Prompt in no time.

Quick Preview to Create File on CMD:

  1. Open Command Prompt in Normal Way (Not in Administrative Format)
  2. Execute the command echo [Entire Text] > [File-Name].txt
  3. Or Execute command copy con [File-Name].txt to write on the Command Prompt.
  4. Or Execute command notepad [File-Name].txt to directly open the application.

Methods to Create A File on Windows using CMD

To start new file on Windows using CMD, the following guidelines should be used. Let us start with the basic Echo Command.

Note: All of these methods should be executed in any certain directory. Otherwise, the operations will not completed. Use the CD Windows Command to enter into any certain Windows directory.

Method 1: Create A File on CMD using ECHO Command

In the Command Prompt, execute the following command. It will directly save the file to the directory mentioned earlier. You have to put some text for it.

Command: echo [Entire Text] > [File-Name].txt

1--Echo-Command

Congratulation! With one simple command, the New Text File on Windows is created using the Command Prompt.

Method 2: Create A File on CMD using COPY CON Command

Execute the following command in the CMD, it will hold the Command Prompt. Now, you can enter any text there. After writing, the entire text, press the CTRL + Z to end the operation & the file will be directly saved to the directory.

Command: copy con [File-Name].txt

2--Copy-Con-Command

Hooray! We have successfully created a Text File on Command Prompt on Windows in a certain directory without opening it.

Method 3: Create A File on CMD using NOTEPAD Command

The following command can be used to open any Text File. Either, you can open the New File with any predefined name or any existing one in the certain directory. It will open the Notepad Windows Application, make changes there & press CTRL + S to save it.

Command: notepad [File-Name].txt

3--Notepad-Command

From the above discussion, we can come to one conclusion File Creation using Command Prompt is one of the easiest tasks that you can execute on the Windows Command Line Tool. Whatever method suits you best can be used to Create Text File on Windows using Command prompt.

Also Read

Frequently Asked Questions to Create a File in CMD

How to create a file on Windows using CMD?

The steps required to create a new file on Windows using CMD are the following.

  1. Open Command Prompt on the device.
  2. Execute the command echo [Entire Text] > [File-Name].txt & press enter.
  3. The File will be directly saved into the directory.

How to create a file on Windows without using CMD?

The guidelines to create a file on Windows without using CMD are the following.

  1. Enter into the driver or any folder.
  2. Right-click inside that folder & go to the New Section.
  3. Select the Notepad File.
  4. Enter text & save it.

Can I create PDF Files using CMD?

Yes! The Command Prompt can create a PDF File from any kind of other file like one Text file. If there is any text file present, it can be converted to a PDF file using the command print [File-Name].txt > [File-Name].pdf. However, the creation of an empty PDF File can be tricky on the CMD.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads