Creating files of specific sizes for testing

Every once in a while I find that I need either a bunch of large files, or  a file of a very specific size for testing, today was one of those days and after a little googleing, I found a way to easily create a file of a specific size.  I needed a file that was 10,000,000 bytes exactly to run some tests.   Step one is getting the hex equivalent of the number of bytes in the file, so I launched the windows calculator and put it into scientific mode, enter the bytes and click on hex A picture named M2 You then need to pad the number with 0 from the left to make it 8 digits so 10MB = 00989680 Step 2 open a command prompt and enter the following -debug filename (and ignore the file not found error) -rcx and press enter -now enter the last four digits of the hex code (in this example 9680) and press enter -rbx and press enter -now enter the first four digits of the code (in this example 0098) and press enter -w enter to write the file -q enter to quit it looks something like this A picture named M3 and when you are done you have a file like this A picture named M4

2 Responses to Creating files of specific sizes for testing
  1. Chris Whisonant
    November 1, 2007 | 8:14 am

    Interested to find some uses for this… Emoticon

  2. Nathan T. Freeman
    November 2, 2007 | 3:18 pm

    Command-line Assembler coding with Debug.

    NICE.