![]() |
VOOZH | about |
Creating a file using Windows GUI is quite simple but did you know you can do the same using the Command Prompt (CMD)? This guide will walk you through multiple methods to create files directly from CMD, giving you more control and efficiency in managing your system.
To start a 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.
This method will directly save the file to the directory mentioned earlier. You have to put some text for it.
Command: echo. > Rapture.txtCongratulation! The New Text File on Windows is created using the Command Prompt with one simple command.
Let's understand this with the below-mentioned example where the file name = 'Rapture'
Command: copy con Rapture.txtHooray! We have successfully created a Text File on Command Prompt on Windows in a certain directory without opening it.
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 Rapture.txtThe following command can be used to create a file in CMD for any specific size. Once you create the file, you do perform tasks accordingly.
For example: Let's create a file of size 10 bytes with the filename as 'Rapture'
Command: fsutil file createnew Rapture.txt 10The type nul command in cmd can be used to create a new file wherein the "type nul" denotes to do nothing and starts with an empty file. Let's understand this with an example below where the filename is 'Rapture'.
Command: type nul >Rapture.txtMastering the ability to create a file in CMD is an essential part of becoming proficient with the command line in Windows. By using the right CMD command to create a file, you can streamline your workflow and perform tasks more efficiently. Whether youβre creating simple text files or working on more complex scripts, understanding how to make a file in CMD gives you greater control over your system.
Also Read