Generating Test Files of A Specific Size

While attempting to unit test the max upload size of files to CRM I needed to generates files of different sizes.  Since Windows XP came out Microsoft has included a utility called fsutil that you can run at the command line to do just this thing.

fsutil file createnew filename filesizeinbytes

1. Open a Command Prompt (As Administrator)
2. Run the following command
fsutil file createnew "c:\temp\test5.txt" 5242880

If you need to convert from Megabytes to Bytes you can use this quick converter: Megabytes to Bytes Converter


Popular posts from this blog

Add User As Local Administrator On Domain Controller

Calling Dataverse Web API in PowerShell using Client Credentials

Windows Server 2008R2 VMs Shut Down After 1 to 2 Hours