Re: generating empty 1gb files

From: Matthias Tacke (Matthias_at_Tacke.de)
Date: 02/17/05


Date: Thu, 17 Feb 2005 21:52:09 +0100

steve wrote:
> Hi all!
>
> Can I use vbscript to generate an empty file that has a specified size?
>
> I know that you can do it by opening a file for writing and then writing
> characters into it until it reaches the desired size.
>
> But can you gneerate the file in some other way so that you can instantly
> generate the file?
>
> I need to generate dummy files that have a size of 1GB.
>
> thanks
>
>
If you are using xp, the fastest way is to use fsutil.exe

fsutil file createnew C:\testfile.txt 1000

where 1000 is filesize in decimal bytes, so if you interpret 1GB
as 1024 * 1024 * 1024 your number is 1073741824.

HTH

-- 
Gruesse  Greetings Saludos   Saluti    Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+


Relevant Pages

  • generating empty 1gb files
    ... Can I use vbscript to generate an empty file that has a specified size? ... I know that you can do it by opening a file for writing and then writing ...
    (microsoft.public.scripting.vbscript)
  • Re: Dont Cross Post
    ... :: Fuckin' child); clear evidence of defective genes from ... You're a funny little ... Steve has you writing fucking short stories. ...
    (rec.gambling.lottery)
  • Re: Chord progression question in Jazz Hanon
    ... You've given me a lot of help here, Steve. ... I tell my theory students to work backwards! ... cadence is the one thing you know, so it's easier for them to work from the ... were going to say before you actually started writing the sentence and what ...
    (rec.music.theory)
  • Re: So Hows Everyone?
    ... until she found out what a newsgroup is. ... > Now you're blaming him for writing it? ... Surely even Steve ... And slapping people is best reserved for those that actually ...
    (misc.writing)
  • Re: Working with binary registry values
    ... have run into a "bug" in vbScript, when writing a binary ... the correct constant you wish install in the registry, ... vbscript I'm trying to write. ... it throws back an error saying the array is out of range. ...
    (microsoft.public.scripting.vbscript)