IDEA: Text file to list correct drive free-space under XP
Many thanks to everyone who posted suggestions:
Post from wr975:
I found that XSET DISKFREE still reports erroneous size on XP, Produces same errors (only least signifant byte word) as DOS shell from XP but contains other useful functions that do work
Post from Sinum
4NT7 (Alternative SHELL sim. cmd.exe prompt) cannot run original (DOS) Batch files wihout requiring extensive rewrite but Take Command runs my DOS Batch files OK but provides
GUI interface for DOS!
The code from Skrommel works perfectly, creating a text file which a "type" command from a batch file displays showing free space on a named backup drive; To get the named drive only, I modified the code:
_________________________________________________________
;Frspace.ahk
; Writes free drive space to a text file, - drives C: to Z: / or %1
; (e.g. %1=L:)
; text file specified is C:\temp\_tmpfree.txt, space in MB
; To run, download and install AutoHotkey from ww.autohotkey.com
;Skrommel @2006
outfile=C:\temp\_tmpfree.txt
SetBatchLines,-1
FileDelete,%outfile%
if 0 < 1 ; if PARAMETER empty
{
; MsgBox This script requires at least 1 incoming parameters
; but it only received %0%.
; ExitApp
drive:=Asc("C")
Loop,% Asc("Z")-Asc("C")
{
drivechar:=Chr(drive)
DriveSpaceFree,space,%drivechar%:
FileAppend,%drivechar%: %space%`r`n,%outfile%
drive+=1
}
ExitApp
}
DriveSpaceFree,space,%1%
FileAppend,%1% %space% MB Free `r`n,%outfile%
return
_________________________________________________________
Many thanks again for all the help from everybody and especially to Skrommel.