Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

On Linux I can create a large number of small files from the command line for various testing purposes:

for x in {1..100}
head -n 512 /dev/urandom > file_$x

What's the best way to achieve something similar on Windows?

share|improve this question
    
This is one of many million reasons why Linux rocks. There might be a proper answer to this one, but I use Python a lot to compensate for the lack of features in Windows. –  tovare Jul 20 '10 at 0:10

2 Answers 2

up vote 1 down vote accepted

Ideas:

  1. Create the files on a Linux box and copy/move them to the Windows box.
  2. Use /dev/urandom from Cygwin
  3. Python's os.urandom() calls Windows' internal cryptographically secure pseudo-random number generator
share|improve this answer
    
python it is then. –  anthony Jul 23 '10 at 21:51

You could possibly copy some of the random files in your TEMP directory if you really don't care about the content of the files that you use for testing. From the command prompt:

CD %TEMP%

...takes you to the temp directory which usually contains plenty of files, although you might need to ignore the ones which are 0kb if these are useless to you.

Copy files from this directory to the directory from which you need to test whatever it is that you are testing?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.