theunrealgladiator
(Lurker)
2002-09-24 05:06 PM
obtain drive size for Symantec install

I am doing a complete uninstall of Mcafee antivirus and a install of Symantec antivirus using the kix32 during login.
I need to check the drive space of every computer that Symantec will be installed on to make sure that there is at least 100MB of hard drive space. I wrote this but when I change the value or the redirectoutput command from 1 to 0 it put a 1 in the hddsize.log file in front of the hard drive size number. Here is what I wrote. Also if there is a way to do this in memory instead of using a file please let me know.

redirectoutput ("c:\temp\hddsize.log") = 0

GetDiskSpace( "C:\" )

IF OPEN (1, "C:\TEMP\HDDSIZE.LOG")

$SPACE = READLINE(1)

IF $SPACE > 102400

messagebox ('Your Workstation does not have enough hard drive space to install Symantec.)

Please Contact Network Services to resolve this issue.','!! Insufficiant Hard Drive Space Detected !!',4144)


Radimus
(KiX Supporter)
2002-09-24 05:09 PM
Re: obtain drive size for Symantec install

$SPACE = GetDiskSpace("C:\")

or

IF GetDiskSpace("C:\") > 102400


Sealeopard
(KiX Master)
2002-09-24 05:37 PM
Re: obtain drive size for Symantec install

And please read the function/command syntax in the KiXtart Manual. It explains in detail how to use REDIRECTOUTPUT and GETDISKSPACE.

NTDOCAdministrator
(KiX Master)
2002-09-24 06:08 PM
Re: obtain drive size for Symantec install

Another sample:

code:
$Nul = REDIRECTOUTPUT("%temp%\hddsize.log",1)
$DiskSpace = GetDiskSpace("C:\") /1024
$RequiredSpace="200"
IF $DiskSpace < $RequiredSpace
$Low="WARNING! - WARNING! : Disk space on your C: drive is low"
Else
$Low=""
Endif
$Nul = REDIRECTOUTPUT("",1)



[ 24. September 2002, 18:11: Message edited by: NTDOC ]