Quickly generate large test files in Windows
Often as a developer, for testing disk performance, or perhaps your internet or network connection speed, you need to generate a large file of a specific size. Windows includes a utility that allows you to quickly generate a file of any size instantly.
Often as a developer, for testing disk performance, or perhaps your internet or network connection speed, you need to generate a large file of a specific size. Windows includes a utility that allows you to quickly generate a file of any size instantly.
This is a command line (DOS) utility, so firstly, open a command prompt (as an administrator if you need to write to protected folders).
To launch a command prompt, hit start and just type command
. You'll see "Command Prompt" appear as the closest match (Remember to right-click and choose "Run as Administrator" if you need admin priviledges). Alterntaively, use the key combination: [WIN]
+R
, and type cmd.exe
to launch a command prompt.
Run the following command:
fsutil file createnew <file> <size in bytes>
For example, this command will create a 1GB file called 1gb.test
in my temp folder:
fsutil file createnew c:\temp\1gb.test 1073741824
Note: the size of the file is specified in bytes. So, you'll need to be specific about the value you choose if you need a specific size.
Googling the converted value (e.g. 100gb in bytes
) will give you a result, but to avoid answers with exponents, here are some pre-calculated equivalent values:
Size | Size in Bytes |
---|---|
1 MB | 1048576 |
100 MB | 104857600 |
1 GB | 1073741824 |
10 GB | 10737418240 |
100 GB | 107374182400 |
1 TB | 1099511627776 |
10 TB | 10995116277760 |
If you don't like using the command line there are various GUI utilities out there that can also do this for you:
Dummy File Creator: http://www.mynikko.com/dummy/
Disk Tools Toolkit: http://www.soft.tahionic.com/download-file-generator/