The fsutil command allows you to create files of the indicated size in a Windows environment. How to do it and what it can be used for.
It is certainly not something you do every day but in some circumstances it might be useful to create a large file in a Windows environment.
Such a file could be exploited to check if there were bad sectors in a hard disk, to test the behavior of file recovery utilities (to make sure for example that files deleted using wiping procedures cannot be restored), to verify the performance of the network connection (locally and over the WAN) during the transfer of large items, to ascertain the behavior of Windows and other utilities in the event that the available space suddenly decreases and so on.
The command that allows the creation of large files in Windows proves to be a very useful trick for experienced users as well as for developers.
Creating a large file in Windows is very simple: just open the command prompt by typing cmd in the search box, go to the folder where you want to generate the file (example cd% userprofile% \ Desktop ) then type the following command .
fsutil file createnew testfile 100000000
In our example we will create a file of size equal to 100 MB in the folder where you are, giving it the name testfile (in this case without any extension).
To create a large file in another folder of your choice, simply specify it if necessary:
fsutil file createnew c: \ temp \ testfile 100000000
The file size is obviously customizable to your liking: you can also create files of tens of gigabytes in size.
The created file is actually empty (English speakers call it dummy file ): trying to open it with a normal hex editor you will only notice the presence of zeros.
The space occupied on the disk, be it a hard disk, an SSD or an external flash drive, is still real so much so that the available space will drastically decrease, creating very large files. Just check this by accessing the This Windows PC window .
By right-clicking on the file created using the fsutil command and choosing Properties, the size indicated by Windows will be smaller than those previously set. For a 100MB file, for example, about 95.3MB would be occupied on disk.
This derives from the fact that the unit of measurement used by Windows is not the megabyte but the mebibyte and related multiples and submultiples as defined by the International Electrotechnical Commission (IEC) in December 1998. We have explained it in the article Hard disk and SSD, the dimensions do not coincide with those declared by the manufacturer .
To generate an exactly 100 MB file in Windows you will therefore have to use the following command:
fsutil file createnew testfile 104857600
It is sufficient to multiply the total weight in megabytes of the file you want to obtain by 1048576 in order to obtain the correct value to pass to the fsutil utility