Computing.Net > Forums > Disk Operating System > copy files to disk until disk full

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

copy files to disk until disk full

Reply to Message Icon

Name: eboy
Date: May 5, 2006 at 13:07:53 Pacific
OS: DOS
CPU/Ram: ...
Product: ...
Comment:

in a batch file, i would like a text file to keep appending to itself until there is no more room left on the disk.

currently I am using type to append:
type file.txt >> file.txt

I would like this to keep looping until the disk is full. I tried to use "if not errorlevel", but my DOS doesn't have an XCOPY (and I can't add XCOPY to the disk. long story) and a regular COPY doesn't seem to set an errorlevel when the disk is full.

So right now, when I run the batch, the file keeps appending to itself until the disk is full. Then it starts spitting out the "Insufficient Disk Space" message in this infinite loop. Is there any way I can stop the loop when this "Insufficient Disk Space" is given? Or is there a command besides XCOPY which will set an errorlevel when the disk is full?

BTW, I can't use any user inputs to stop the loop. It must all be automatic.

Thanks in advance.



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: May 5, 2006 at 16:41:27 Pacific
Reply:

Seems very odd that copy does not set errorlevel.

Try this:

::== FILLerUP.bat
@echo off
:loop
dir file.txt|find "FILE.TXT">before
type file.txt >> file.txt
dir file.txt|find "FILE.TXT">after
fc before after>nul
if errorlevel 1 goto :loop
:: DONE


If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: Jennifer SUMN
Date: May 10, 2006 at 08:06:40 Pacific
Reply:

I'm curious as to why you'd want to fill up the disk space. Just wundrin...

Life is more painless for those who are brainless.


0

Response Number 3
Name: Mechanix2Go
Date: May 11, 2006 at 04:31:45 Pacific
Reply:

Hi Jennifer,

me too


=====================================
If at first you don't succeed, you're about average.

M2



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: copy files to disk until disk full

copying files to one directory www.computing.net/answers/dos/copying-files-to-one-directory/12450.html

How can I make a file from disk install! www.computing.net/answers/dos/how-can-i-make-a-file-from-disk-install/5654.html

COPY file to multiple directories www.computing.net/answers/dos/copy-file-to-multiple-directories/14518.html