Many times during my operations, I came across a requirement to create a file of specific size. In earlier times, the requirement was to create a dummy file of size in few MBs. That dumb procedure I used to follow was copy pasting images into word document and save it as desired file. But today my requirement is to create 1GB file and this time I feared about copy pasting the files as it is really waste of efforts. I just looked around in google and came across a fantastic way to my job. Here it is…
fsutil file createnew c:\tempmyfile.txt (1gb)
Wow..it created the file in few seconds time and my requirement is served with less efforts. There are still people around us who depend on their own cum dump techniques to create such large files for their requirements. I thought of making a post for helping such people, and this page born.
Happy Learning..,
Sitaram Pamarthi
Comments on this entry are closed.
Great! Thank you, very useful to test alerting system, simulating a disk going over its thereshold.
Very nice find. I just used this to reserve space on a SQL Server log drive. The big file reserves space so that if someone screws up and overflows the log by resetting the recovery model to FULL we can get back enough space on the drive to run DBCC SHRINKFILE successfully.
Thank you!