ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

DONE: Drive space monitor

(1/3) > >>

deano:
I went around to my friends house last weekend to fix his computer.  One of the problems was that he had about 4mb of free space on C.  After deleting a temp CD image file he nearly had 1gb free and things had improved.

I do alot of tech support for friends and family.  I think it would be useful to have a little program that I could give out (a single small exe) that can sit in the startup folder. 

To configure the program I state how much disk space I would ideally like to be free or state a percentage.

On bootup of Windows it does a little check to see if this amount of space is indeed free.  If not a message pops up (we should be able to insert whatever we want) with a warning.  e.g "Hey Dan, Windows is running low on diskspace. Give me a call and we will sort it out - Deano".

Edvard:
Yet again, Autohotkey comes to the rescue:

--- ---DriveSpaceFree, FreeSpace, C:\
If FreeSpace < 999
MsgBox, 48, Low Disk Warning!, Hey Dan, Windows is running low on diskspace. `nGive me a call and we will sort it out - Deano
ExitApp
Replace the 'If FreeSpace' value and the message with your own preference. Autohotkey also sports a command DriveGet which can get all kinds of diagnostic info about any disk.

Let me chew on this one a little more, I'd like something like your idea for myself...

Edvard:
Okay here's another Quick n Dirty one for checking percentages rather than freespace:

--- ---DriveSpaceFree, FreeSpace, C:\
DriveGet, DriveCap, capacity, C:\
Perc:=Round(FreeSpace/DriveCap*100)
If Perc < 10
MsgBox, 48, Low Disk Warning!, Hey Dan, Windows is running low on diskspace. `nGive me a call and we will sort it out - Deano
ExitAppJust modify the target percentage and you're good.

and here's a whole enchilada version that reads a .ini file you can edit for different situations:

--- ---;First we'll check for the DriveAlarm.ini file, and if it's not there, make one with some sane values.
IfNotExist DriveAlarm.ini
FileAppend, [Drive]`nDrv=C:\`n[Type]`n;1=free percentage `n;2=free Megabytes`nTyp=2`n[Target]`n;If type is set to 1 this is a percentage value minus the percent sign`n;if type is set to 2 this is a value in megabytes rounded up.`nTarg=999`n[Message]`n;And a customisable message to tag at the end`n;like 'empty your Recycle Bin' or something`nMsg=, %A_WorkingDir%\DriveAlarm.ini
;Now we'll read the values into variables...
IniRead, Drv, DriveAlarm.ini, Drive, Drv
IniRead, Typ, DriveAlarm.ini, Type, Typ
IniRead, Targ, DriveAlarm.ini, Target, Targ
IniRead, Msg, DriveAlarm.ini, Message, Msg
;...and get the disk capacity and free space
DriveSpaceFree, FrSpc, %Drv%
DriveGet, DrvCap, Capacity, %Drv%
Perc:=Round(FrSpc/DrvCap*100)
;Figure out what type of space detection you want and run the alarm tests accordingly
If Typ=1
Gosub, Percent
If Typ=2
Gosub, FreeMB
;and exit gracefully if all is good...
ExitApp

Percent:
If Perc <= %Targ%
MsgBox, 48, Low Disk Warning!, Your %Drv% drive is down to %Perc%`% capacity.`n%Msg%
Return

FreeMB:
If FrSpc < %Targ%
MsgBox, 48, Low Disk Warning!, Your %Drv% drive is down to %FrSpc% Megabytes...`n%Msg%
Return

Note: If you want to run this at startup, I would recommend you put it someplace safe and put a shortcut in startup instead.

mouser:
edvard might be nice to build an exe and pack it along with ahk in a zip and attach it to a post :)
then i can add it to http://codingsnacks.donationcoder.com

Edvard:
Oops... here go

I've changed my above post and the files to reflect the addition of a custom tag message that can be customised in the ini file.

Not everybody has a "Deano" they can call ;D

Navigation

[0] Message Index

[#] Next page

Go to full version