Okay here's another Quick n Dirty one for checking percentages rather than freespace:
DriveSpaceFree, FreeSpace, C:\
DriveGet, DriveCap, capacity, C:\
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
Just 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.
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%
;Figure out what type of space detection you want and run the alarm tests accordingly
;and exit gracefully if all is good...
If Perc <= %Targ%
MsgBox, 48, Low Disk Warning!, Your %Drv% drive is down to %Perc%`% capacity.`n%Msg%
If FrSpc < %Targ%
MsgBox, 48, Low Disk Warning!, Your %Drv% drive is down to %FrSpc% Megabytes...`n%Msg%
Note: If you want to run this at startup, I would recommend you put it someplace safe and put a shortcut
in startup instead.