hi all,
very long time no post...
i am trying to get 'getdiskspace' to work at login for all students.
however, the number that is returned doesn't make sense.[in the script the number '645310' is what i got returned for a 15.04Mb homedrive]
if students' homedrive > 15mb then warn them and eventually stop access to their homedrive.
i have tried using 3rd party commandline utils to get a dirtotal, but they're too slow or not 'pipeable' into a script.
i've also mucked around with 'diruse' but can't get it to work.
at the moment i just scan users' drives at the end of the day and put a token file in. that triggers a response from the kix login script and deals with it accordingly.
but that is not automatic detection, which is what i'm trying to work out.
this is part of the script
code:
;
$udrive=GetDiskSpace("\\server_6\zztop$\")
SELECT
CASE $udrive < 645310 AND exist ("\\server_6\zztop$\m1")
del "\\server_6\zztop$\m1"
CASE $udrive < 645310 AND exist ("\\server_6\zztop$\m2")
del "\\server_6\zztop$\m2"
CASE $udrive > 645310 AND exist ("\\server_6\zztop$\m2")
messagebox ("Your U: drive total size is larger than 15Mb"
+chr(10)+" "
+chr(10)+"It is $udrive big"
+chr(10)+"You no longer have access to your U: drive"
+chr(10)+" "
+chr(10)+" "
+chr(10)+"To regain access to your U: drive"
+chr(10)+" Please contact Mr. Bouman","Access DENIED" ,16)
use u: /delete
CASE $udrive > 645310 AND exist ("\\server_6\zztop$\m1")
messagebox ("Your U: drive total size is larger than 15Mb"
+chr(10)+"This is your last warning"
+chr(10)+" "
+chr(10)+"You WILL be denied access if you "
+chr(10)+"fail to reduce your U: drive","CTS network notice" ,32)
+chr(10)+" "
+chr(10)+"If you need help deleting files, please see Mr. Bouman today."
del "\\server_6\zztop$\m1"
copy "\\server_6\netlogon\m2" "\\server_6\zztop$\m2"
CASE $udrive > 645310
messagebox ("Your U: drive total size is larger than 15Mb"
+chr(10)+"Please delete files to reduce the size of"
+chr(10)+"your U: drive. "
+chr(10)+" "
+chr(10)+"See Mr Bouman if you need special"
+chr(10)+"consideration, eg; If you are working"
+chr(10)+"on a big project."
+chr(10)+" "
+chr(10)+"Otherwise you WILL be denied access if you "
+chr(10)+"fail to reduce your U: drive after the 2nd notice","CTS network notice" ,32)
+chr(10)+" "
+chr(10)+"If you want to delete files now, please see Mr. Bouman today."
copy "\\server_6\netlogon\m1" "\\server_6\zztop$\m1"
ENDSELECT
i'm very much obliged for your kind replies.