|
I tried that and it doesn't recognize $DOUBLE as a number
;*** In this section we run DISKUSE.EXE to get total bytes of Userhome $Readfile = "\\$SERVER\QUOTAS$\READFILE.TXT" $Writefile = "\\$SERVER\QUOTAS$\WRITEFILE.TXT"
SHELL '%comspec% /c %WINDIR%\PSEXEC.EXE \\$SERVER -u DOMAIN\USERID -p PASSWORD C:\WINNT\DISKUSE.EXE F:\USERS\$strUserHome1 /u:DOMAIN\$strUserHome1 /s /f:$ReadFile'
;* In this section we remove useless lines using YANK.EXE from the file *** ;USERID = local admin on servers SHELL '%comspec% /c %WINDIR%\PSEXEC.EXE \\$SERVER -u DOMAIN\USERID -p PASSWORD C:\WINNT\YANK.EXE /i "$ReadFile" "DISK"' SHELL '%comspec% /c %WINDIR%\PSEXEC.EXE \\$SERVER -u DOMAIN\USERID -p PASSWORD C:\WINNT\YANK.EXE /i "$ReadFile" "----"' SHELL '%comspec% /c %WINDIR%\PSEXEC.EXE \\$SERVER -u DOMAIN\USERID -p PASSWORD C:\WINNT\YANK.EXE /i "$ReadFile" "USER"'
;*** In this section we read the value in and write it to new file IF Open(3,"$Readfile", ) =0 AT(4,1) $x = ReadLine(3) While @Error = 0 IF Open(5, $Writefile, 5) = 0 $trimx = Trim($x) $y = WriteLine(5,$trimx) $z = Close(5) ELSE Beep ? "Writing Writefile text file failed with error code " @ERROR SLEEP 3 ENDIF $x = ReadLine(3) Loop ELSE ENDIF $x = Close(3) $z = Close(5)
;** In this section we extract the number from the newly created TXT file. More importantly, we now have the number in the variable $HOMEmb
DIM $HOMEmb DIM $HOMEbytes DIM $HOMEbytes2
CLS
IF Open(3,"$WriteFile", ) =0 AT(4,1) $v = ReadLine(3) $trimv = Trim($v)
$HOMEbytes = SUBSTR("$trimv",12,25) $DOUBLE = 0.0+ $HOMEbytes $HOMEmb = $DOUBLE / 1048576
? "Homebytes = $HOMEbytes" ? "Double = $DOUBLE" ? "Homemb = $HOMEmb" $v = ReadLine(3) $v = Close(3) SLEEP 10 ENDIF
|