How to know the disk's space during a process?

  • Thread starter Thread starter Don Juan
  • Start date Start date
D

Don Juan

Guest
Hello all.
I need to know if it's possible to know the size of a hard disk during a
time.
E.g. If I have a 100Gb HD, after run the process the HD will be 30Gb, but
during this process the application generated temps and logs files. These
files sometimes are so big and process crashes.
I need to know the free space in disks by doing this test.
(I run my application and only log files were about 20Gb after the
installation the log files are delete automaticaly).

May be there is a tool to measure it?
Thanks a lot.
 
Re: How to know the disk's space during a process?


"Don Juan" <Juanete@gmail.com> wrote in message
news:50EA7A68-C88B-477E-9784-0A8117DA0AF6@microsoft.com...
> Hello all.
> I need to know if it's possible to know the size of a hard disk during a
> time.
> E.g. If I have a 100Gb HD, after run the process the HD will be 30Gb, but
> during this process the application generated temps and logs files. These
> files sometimes are so big and process crashes.
> I need to know the free space in disks by doing this test.
> (I run my application and only log files were about 20Gb after the
> installation the log files are delete automaticaly).
>
> May be there is a tool to measure it?
> Thanks a lot.


If your working processes require such large amounts of disk
space then your best bet is to install a larger disk. If this is
not an option then you could start the following batch file just
before you launch your process:
01. @echo off
02. set count=30
03. set delay=60
04. set sample=1
05. set LogFile=c:\DiskSpace.txt
06.
07. echo Logging started on %date% at %time:~0,5% > %LogFile%
08. echo ========================================== >> %LogFile%
09. for /L %%a in (1,1,%count%) do call :Sub
10. start /b notepad %LogFile%
11. goto :eof
12.
13. :Sub
14. echo Taking sample # %sample%
15. set /a sample=%Sample% + 1
16. for /F "tokens=3*" %%b in ('dir c:\ ^| find /i "bytes free"') do echo
%time:~0,5% %%b %%c >> %LogFile%
17. ping localhost -n %delay% > nul

The batch file will log the amount of free space on C: about
once every 60 seconds (set in Line 03). It will do this
30 times (set in Line 02). Watch out for Line 16 - it is a
very long line!
Do not retype this batch file - use copy & paste instead!
 
Re: How to know the disk's space during a process?

Thanks a lot, very usefull.

"Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
news:%23Rcpm$wvIHA.4916@TK2MSFTNGP03.phx.gbl...
>
> "Don Juan" <Juanete@gmail.com> wrote in message
> news:50EA7A68-C88B-477E-9784-0A8117DA0AF6@microsoft.com...
>> Hello all.
>> I need to know if it's possible to know the size of a hard disk during a
>> time.
>> E.g. If I have a 100Gb HD, after run the process the HD will be 30Gb, but
>> during this process the application generated temps and logs files.
>> These files sometimes are so big and process crashes.
>> I need to know the free space in disks by doing this test.
>> (I run my application and only log files were about 20Gb after the
>> installation the log files are delete automaticaly).
>>
>> May be there is a tool to measure it?
>> Thanks a lot.

>
> If your working processes require such large amounts of disk
> space then your best bet is to install a larger disk. If this is
> not an option then you could start the following batch file just
> before you launch your process:
> 01. @echo off
> 02. set count=30
> 03. set delay=60
> 04. set sample=1
> 05. set LogFile=c:\DiskSpace.txt
> 06.
> 07. echo Logging started on %date% at %time:~0,5% > %LogFile%
> 08. echo ========================================== >> %LogFile%
> 09. for /L %%a in (1,1,%count%) do call :Sub
> 10. start /b notepad %LogFile%
> 11. goto :eof
> 12.
> 13. :Sub
> 14. echo Taking sample # %sample%
> 15. set /a sample=%Sample% + 1
> 16. for /F "tokens=3*" %%b in ('dir c:\ ^| find /i "bytes free"') do echo
> %time:~0,5% %%b %%c >> %LogFile%
> 17. ping localhost -n %delay% > nul
>
> The batch file will log the amount of free space on C: about
> once every 60 seconds (set in Line 03). It will do this
> 30 times (set in Line 02). Watch out for Line 16 - it is a
> very long line!
> Do not retype this batch file - use copy & paste instead!
>
>
 
Re: How to know the disk's space during a process?

2 more remarks,

1) I would question "the process" and ask why it is using such large files
and such an amount of diskspace

2) You could use a tool to monitor disk space and alert, most monitoring
systems will allow you to do that. Here is one which will cost nothing
http://www.woodstone.nu/salive/

HTH,
Edwin

"Don Juan" <Juanete@gmail.com> wrote in message
news:6812F730-BBF0-43F7-ABCF-E0346BD4A007@microsoft.com...
> Thanks a lot, very usefull.
>
> "Pegasus (MVP)" <I.can@fly.com.oz> wrote in message
> news:%23Rcpm$wvIHA.4916@TK2MSFTNGP03.phx.gbl...
> >
> > "Don Juan" <Juanete@gmail.com> wrote in message
> > news:50EA7A68-C88B-477E-9784-0A8117DA0AF6@microsoft.com...
> >> Hello all.
> >> I need to know if it's possible to know the size of a hard disk during

a
> >> time.
> >> E.g. If I have a 100Gb HD, after run the process the HD will be 30Gb,

but
> >> during this process the application generated temps and logs files.
> >> These files sometimes are so big and process crashes.
> >> I need to know the free space in disks by doing this test.
> >> (I run my application and only log files were about 20Gb after the
> >> installation the log files are delete automaticaly).
> >>
> >> May be there is a tool to measure it?
> >> Thanks a lot.

> >
> > If your working processes require such large amounts of disk
> > space then your best bet is to install a larger disk. If this is
> > not an option then you could start the following batch file just
> > before you launch your process:
> > 01. @echo off
> > 02. set count=30
> > 03. set delay=60
> > 04. set sample=1
> > 05. set LogFile=c:\DiskSpace.txt
> > 06.
> > 07. echo Logging started on %date% at %time:~0,5% > %LogFile%
> > 08. echo ========================================== >> %LogFile%
> > 09. for /L %%a in (1,1,%count%) do call :Sub
> > 10. start /b notepad %LogFile%
> > 11. goto :eof
> > 12.
> > 13. :Sub
> > 14. echo Taking sample # %sample%
> > 15. set /a sample=%Sample% + 1
> > 16. for /F "tokens=3*" %%b in ('dir c:\ ^| find /i "bytes free"') do

echo
> > %time:~0,5% %%b %%c >> %LogFile%
> > 17. ping localhost -n %delay% > nul
> >
> > The batch file will log the amount of free space on C: about
> > once every 60 seconds (set in Line 03). It will do this
> > 30 times (set in Line 02). Watch out for Line 16 - it is a
> > very long line!
> > Do not retype this batch file - use copy & paste instead!
> >
> >

>
 
Back
Top