Page 1 of 1 1
Topic Options
#212361 - 2017-03-23 12:05 AM Check Available Disk Space
JustMark Offline
Fresh Scripter

Registered: 2013-03-20
Posts: 7
Loc: Arizona
Hello,
I am writing a Kix file to install some software, but I want to know if there would be enough room on the users computer before it tries to install.
I can use this in a .bat file:
FOR /F "usebackq tokens=3" %%s IN (`DIR C:\ /-C /-O /W`) DO (
SET FREE_SPACE=%%s
)
ECHO FREE_SPACE is %FREE_SPACE%

But it doesn't work in the Kix file. Is there another way to find the available disk space using Kix?
I'm using Windows 7.

Thanks,
Mark

Top
#212363 - 2017-03-23 12:52 AM Re: Check Available Disk Space [Re: JustMark]
Schavuit Offline
Fresh Scripter

Registered: 2016-09-30
Posts: 14
Loc: South Korea
try this and see if this will work for you

 PHP:
;************************************************************************ ;***** Determine HD free space on C: ***** ;************************************************************************ ? "Checking diskspace..." ? $HDSPACE = GetDiskSpace( "C:\" ) $HDGBSPACE = ($HDSPACE / 1048576) If $HDSPACE => "2097158" $HDSPACE_S = "Good" $HDSPACE = C:\ + " has " + $HDSPACE + " kb (about " + $HDGBSPACE + "GB) of free space" Else $HDSPACE_S = "Bad" $HDSPACE = $OS_LOC + " has " + $HDSPACE + " kb of free space" $Message2 = $Message2 + Chr(13) + "Low hard drive space - " + $HDSPACE EndIf ? 'HDSPACE ' + $HDSPACE_S + " " + $HDSPACE ? ? "End of Check..." ? ;************************************************************************

Top
#212371 - 2017-03-23 07:30 PM Re: Check Available Disk Space [Re: Schavuit]
JustMark Offline
Fresh Scripter

Registered: 2013-03-20
Posts: 7
Loc: Arizona
Hi Schavuit,
Thank you for your help on this. I really appreciate it.

Best regards,
Mark

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 687 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.052 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org