topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday April 16, 2024, 9:44 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Text file to list correct drive free-space under XP  (Read 8077 times)

TWmailrec

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 130
    • View Profile
    • Donate to Member
 ;)
If you create a DOS BATCH prog to automate Backup/ZIP, DOS wrongly
reports free space on a named partition under XP.
It would be useful to have a program to create a text file (for display in a DOS Batch prog) showing accurate free space (GB) on a named partition.
My searches havent revealed an existing program that does this accurately under XP.
(DOS progs I have are written for WIN98/95/WIN3.1)

Can anyone help!

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • View Profile
    • Donate to Member
Re: IDEA: Text file to list correct drive free-space under XP
« Reply #1 on: March 06, 2006, 02:10 PM »
There's no DOS in XP but some tools still work. You can try XSet to enhance your command scripts.

-disks-----------------------------------------------------------------------
-----------------------------------------------------------------------------
DISKFREE   Free disk space          DiskFree    C:             16939008
DISKFREEK  Free disk space K        DiskFreeK   C:                16542
DISKFREEM  Free disk space M        DiskFreeM   C:                   16
DISKSIZE   Disk size                DiskSize    C:             33419264
DISKSIZEK  Disk size                DiskSizeK   C:                32636
DISKSIZEM  Disk size                DiskSizeM   C:                   31
-----------------------------------------------------------------------------

You could also move on and use Authotkey or Autoit for your scripts.
« Last Edit: March 06, 2006, 02:12 PM by wr975 »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: IDEA: Text file to list correct drive free-space under XP
« Reply #2 on: March 06, 2006, 02:24 PM »
You could also move on and use Authotkey or Autoit for your scripts.
Agreed  :Thmbsup: :Thmbsup:

But still, could you be more precise on what you're looking for, TWmailrec?

sinum

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 12
    • View Profile
    • Donate to Member
Re: IDEA: Text file to list correct drive free-space under XP
« Reply #3 on: March 06, 2006, 05:11 PM »
Why dont use 4NT from http://www.jpsoftware.com/  works 100%.
They have an old Version ( 4DOS ) for free. 90% on XP i think.
.sinum.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: Text file to list correct drive free-space under XP
« Reply #4 on: March 06, 2006, 05:36 PM »
 :) Can you work with this?

Skrommel


;FindFree.ahk
; Writes free drive space to a text file.
; To run, download and install AutoHotkey from www.autohotkey.com
;Skrommel @2006

outfile=C:\Temp\out.txt

SetBatchLines,-1
FileDelete,%outfile%
drive:=Asc("A")
Loop,% Asc("Z")-Asc("A")
{
  drivechar:=Chr(drive)
  DriveSpaceFree,space,%drivechar%:
  FileAppend,%drivechar%: %space%`n,%outfile%
  drive+=1
}

TWmailrec

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 130
    • View Profile
    • Donate to Member
Re: IDEA: Text file to list correct drive free-space under XP
« Reply #5 on: March 09, 2006, 11:44 PM »
Many thanks for the great suggestions;

I have downloaded XSET & 4NT and will explore possibilities.

I am new to Autohotkey programming, but prog from Skrommel looks very interesting, especially if it can be modified to take drive designated by command parameter; perhaps:

_______________________________________________________
;FindFree.ahk
; Writes free drive space to a text file.
; To run, download and install AutoHotkey from www.autohotkey.com
;Skrommel @2006

outfile=C:\Temp\out.txt

SetBatchLines,-1
FileDelete,%outfile%
drive:=%1%

  drivechar:=Chr(drive)
  DriveSpaceFree,space,%drivechar%:
  FileAppend,%drivechar%: %space%`n,%outfile%
_______________________________________________________


TWmailrec

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 130
    • View Profile
    • Donate to Member
Re: IDEA: Text file to list correct drive free-space under XP
« Reply #6 on: March 12, 2006, 07:45 PM »
 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.