How to create a file from a Command line in Windows 10 ?

Published on July 28, 2016 by abundantcode

Filed under Windows

Last modified July 28, 2016

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 4443 times

There are two command that you can use to create a file from a command line in Windows 10. These include
– echo
– fsutil

How to create a file from a Command line in Windows 10 ?

The fsutil command can be used to create a file  by specifying the size but if you need to write a data to the file during its creation , you can use the echo command.

Syntax of fsutil command

fsutil file createnew <Name_Of_the_File> <No_Of_Bytes>

Syntax of echo command

echo file_content  > name_of_the_file.txt

Example

D:\abundantcode2>echo "welcome to abundantcode.com" > abundantcode.txt

D:\abundantcode2>dir
 Volume in drive D is New Volume
 Volume Serial Number is 1E5B-86FF

 Directory of D:\abundantcode2

07/28/2016  02:22 PM    <DIR>          .
07/28/2016  02:22 PM    <DIR>          ..
07/28/2016  02:22 PM                32 abundantcode.txt
               1 File(s)             32 bytes
               2 Dir(s)  327,704,076,288 bytes free

D:\abundantcode2>

image

Leave a Comment


x

You might be Interested in these Posts

How to delete user account from command line in Windows 10 ?

You can delete a user account from command line in Windows 10 using the net user command and specify...

How to add new user account from command line in Windows 10 ?

You can add a new user account in Windows 10 using command prompt using the net user command and pas...

How to open display settings from command line in Windows 10 ?

The display properties can be found in the settings app in Windows 10 which lets the users to config...