Windows 7 – How to generate test files of any size

The following DOS command can be used to create a test file of any length.

fsutil file createnew <filename> <filesize in bytes>

For example, to create a 10 megabyte test file:

  1. Click on the ‘Start’ button
  2. In the search box type ‘cmd’
  3. Right-click on cmd.exe and choose ‘Run as administrator’
  4. Windows7-GenerateFile1
  5. Enter the following command:
  6. fsutil file createnew C:\TestFile.txt 10485760
  7. Windows7-GenerateFile2
  8. The file will be located in the C:\ directory.