Page 1 of 1 1
Topic Options
#32370 - 2002-11-13 04:49 PM getdiskspace
Plkowner Offline
Lurker

Registered: 2002-11-13
Posts: 3
I can't seem to get my script to output any disk space information. I have tried the example provided in the kix2001.doc but still no go, any help would be great.
Top
#32371 - 2002-11-13 04:52 PM Re: getdiskspace
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Post your code sample so we can see what's happening...
_________________________
We all live in a Yellow Subroutine...

Top
#32372 - 2002-11-13 05:43 PM Re: getdiskspace
Plkowner Offline
Lurker

Registered: 2002-11-13
Posts: 3
$Result = GetDiskSpace( “C:\” )

this is the line as it is entered into the script. Thanks!

Top
#32373 - 2002-11-13 05:55 PM Re: getdiskspace
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
Take out the quotes and the spaces after and before the ().

I got your script to work like this :

code:
$Result=GetDiskSpace(C:\)
? $Result

Z.

Top
#32374 - 2002-11-13 06:01 PM Re: getdiskspace
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
In this case, the spaces and quotes are not the issue. The function requires string input so (C:\), ( "C:\" ), ("C:\") are equivalent...
Rather, you need to 'write' the returned value...
code:
$result=getdiskspace("c:\")
If redirectoutput("") = 0 ; to the console
"free space is : "+$result+" Kbytes"?
Endif
If redirectoutput("mylogfile.log") = 0 ; to a file
"free space is : "+$result+" Kbytes"?
Endif
If redirectoutput("") = 0 ; back to the console
"all done"?
Endif





[ 13. November 2002, 18:18: Message edited by: Waltz ]
_________________________
We all live in a Yellow Subroutine...

Top
#32375 - 2002-11-13 07:02 PM Re: getdiskspace
Plkowner Offline
Lurker

Registered: 2002-11-13
Posts: 3
Thanks to both of the responses, I am new to this but appreciate being able to get some help.
Top
#32376 - 2002-11-13 07:06 PM Re: getdiskspace
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
It's those damn 'curly' quotes from the manual. They messed me up lots in the beginning. Go with straight ones.

Be forever wary of the curlies...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#32377 - 2002-11-13 07:23 PM Re: getdiskspace
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Good eyes, Les...
My keyboard must be broken - I don't have any curlies and my password is always asterisks... [Confused]
_________________________
We all live in a Yellow Subroutine...

Top
#32378 - 2002-12-08 04:59 PM Re: getdiskspace
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Welcome to the board.

For other ideas when WMI isn't available.

Take a close look at our topic KIX-SCRIPT: how to determine your local disk configuration (fe. HPFS,NTFS,FAT) + size

greetings
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#32379 - 2002-12-08 05:17 PM Re: getdiskspace
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
waltz, sure you have curlies...
for some quotes you could execute this script:
code:
chr(&22) ? ;normal quote
chr(&27) ? ;single quote
chr(&60) ?
chr(&82) ? ;single low quote
chr(&84) ? ;double low quote
chr(&91) ?
chr(&92) ?
chr(&93) ?
chr(&94) ?
chr(&B4) ?
chr(&B4) ?

these are the "quotes" in basic 8-ascii western ascii-table
_________________________
!

download KiXnet

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 138 anonymous users online.
Newest Members
MaikSimon, kvn317, kixtarts2025, SERoyalty, mytar
17872 Registered Users

Generated in 0.062 seconds in which 0.025 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