Path: utzoo!attcan!uunet!btni!hdr!unocss!fritz From: fritz@unocss.UUCP (Tim Russell) Newsgroups: comp.os.vms Subject: Re: Getting rid of phantom NEW MAIL msgs upon login... Summary: A DCL procedure Message-ID: <286@unocss.UUCP> Date: 24 May 88 17:00:38 GMT References: <11957897978315001@bert.chem.wisc.edu> <400@csdgwy.unsw.edu.au> <4872@batcomputer.tn.cornell.edu> Organization: U. of Nebraska at Omaha Lines: 48 Well, since several people seem to have missed it the first time, (or was it ever posted here? I forget where I got it..), I thought I'd post the final answer to the mail count problem. This is MAILCOUNT.COM, a program that updates SYS$SYSTEM:MAILUAF.DAT with whatever count you want. The only use I can see for it is to set the count back to zero, but then, it might be fun to see someone's expression when they login and see "You have 9999 new mail messages"... :-) Anyway, it needs BYPASS, so if you don't have it, give this program to a manager or someone who does. ------------------------------/ Cut Here /------------------------------------ $! $! Command file SET_NEWMAIL_COUNT.COM to examine and optionally change $! the 'newmail' counter for a VAXmail user. $! $ OLD_PRIV=F$SETPRIV("BYPASS") $ IF .NOT. F$PRIVILEGE("BYPASS") THEN $GOTO NOPRIV $ READ/PROMPT="Enter User name to change: " SYS$COMMAND USER $ USER=F$EDIT(USER,"TRIM,COMPRESS,UPCASE") $ OPEN/SHARE=WRITE/READ/WRITE FILE SYS$SYSTEM:VMSMAIL.DAT $ READ/INDEX=0/KEY="''USER'"/ERROR=NONE_SUCH FILE RECORD $ NEW_CNT=F$CVUI(33*8,16,RECORD) ! Determine count from record $ WRITE SYS$OUTPUT "User ''user' has ''new_cnt' new messages." $ READ/PROMPT="Enter new count to leave untouched " SYS$COMMAND CNT $ IF CNT .NES. "" THEN $GOTO MODIFY $ WRITE SYS$OUTPUT "Count unchanged" $ GOTO XIT $MODIFY: $ RECORD[33*8,16]=F$INTEGER(CNT) !alter field in record $ WRITE/UPDATE FILE RECORD !put record back $ GOTO XIT $NONE_SUCH: $ WRITE SYS$OUTPUT "User ''user' does not exist" $XIT: $ CLOSE FILE $ SET_PRIV=F$SETPRIV(OLD_PRIV) $ EXIT $NOPRIV: $WRITE SYS$OUTPUT "Not enough privileges...." $ EXIT -- ---------------------------------+-------------------------------------------- Tim Russell, Computer Operator | Internet: oper06%zeus.dnet@fergvax.unl.edu Campus Computing | Bitnet: OPER06@UNOMA1, CONSLT32@UNOMA1 University of Nebraska at Omaha | UUCP: {ihnp4}!unocss!fritz