JSI Tip 7400. How do I create a sparse file of a specific size in Windows XP and greater?

If you have the need to create a file of a specific size, and don't care about the contents, Windows XP, and greater (Windows NT 5.1+), has the fsutil.exe command-line tool.

The syntax for using fsutil.exe to create a new file is:

fsutil file createnew FileName Size

where FileName is the name of the file, such as test.txt, or c:\folder\test.doc, and Size is the size of the file in bytes.

NOTE: This is useful when an old install program fails because too much freespace causes its' freespace calculation to overflow.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.