Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Generate File of Specific Size in Windows (Very Simple)

Sometimes you just need a large file to test some web forms, APIs, or disk performances.

Usually, you would go to a site to download that file.

But in this post, I’m going to show you how to quickly and easily Generate a Binary file of any size on a Windows machine.

So you don’t have to waste your time.

Let’s get started!

Open the Command Prompt as Administrator.

Run the following command:

fsutil file createnew

For example, this command will create a 1GB file called dummyFileon my Desktop.

fsutil file createnew C:\Users\Carol\Desktop\dummyFile 1073741824


Here is a table with some common file sizes:

MB Bytes (in binary)
1 1048576
5 5242880
10 10485760
50 52428800
100 104857600
500 524288000
1000 1048576000
10000 10485760000

Just out of curiosity, if we open the file and inspect its content using Visual Studio Code Hex Editor extension we can see the file is indeed binary and it’s full of 00s.

In human language, that means it’s full of NULL values.

That’s it!

Happy coding


Let me know what you think about this article through comments below, or on Twitter at @pelu_carol.

If you find this article helpful, please share it with others and subscribe to the blog to support me, and receive a bi-monthly-ish e-mail notification on my latest articles.



This post first appeared on Neutron Dev, please read the originial post: here

Share the post

Generate File of Specific Size in Windows (Very Simple)

×

Subscribe to Neutron Dev

Get updates delivered right to your inbox!

Thank you for your subscription

×