|
Hi all,
I am using the following script, but when I write it to a file instead of getting the value for $memory and $model, I get $memory and $model. Can you guys see what am I doing wrong? thanks Anna
$file="c:\batch\mylog.txt" go "C:" SHELL 'CMD /X/C "WINMSD /S /F"' OPEN(1, "@curdir\@WKSTA.TXT")=0 $counter=0 ;************************************** $LINE=READLINE(1) WHILE @ERROR=0 and $counter<>2 IF INSTR($LINE,"Total Physical Memory") $counter=$counter+1 $LINE=READLINE(1) $memory=$LINE ENDIF IF INSTR ($line,"System Model") $counter=$counter+1 $line=readline(1) $model=$line endif
IF INSTR($LINE,"Drives Report") $counter=$counter+1 $LINE=READLINE(1) $LINE=READLINE(1) $total=instr($line,"Total:") $free=instr($line,"KB"+chr(44)+" Free:") $tot=substr($line,$total+7,$free-$total-7)
endif $LINE=READLINE(1) LOOP $cl=CLOSE(1) $wri=writeprofilestring ("$file","@wksta","Physical Memory", "$memory") $wri=writeprofilestring ("$file","@wksta","System Model", "$model") $wri=Writeprofilestring("$file","@wksta", "C: Drive Size","$tot")
|