Code:
  

Function CheckPst
$Index = 0
$KeyName = EnumKey("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"+
"MS Exchange Settings", $Index)
while @error=0
$Displayname = ReadValue("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"+
"MS Exchange Settings\$Keyname", "001e6700")
If @error=0
$fso = CreateObject("Scripting.FileSystemObject")
$objFile = $fso.GetFile($Displayname)
$filesize=$objFile.Size
If $filesize>1500000000
;>1.5GB
$dev=ReadProfileString($IniFilePath,"PstID",$Displayname)
if $dev=""
WriteProfileString($IniFilePath,"PstID",$Displayname,$filesize)
$Message=$Message+"The pst file "+$Displayname+" is over size, Please notify user. The current size is : "+($filesize / 1024 /1024 ) +"MB;"
else
if $filesize-$dev>100000000
SendError("Warning!Warning!Warning!"+" The pst file "+$Displayname+
" will over maximum size , Must Be Attention!. The current size is : "+($filesize / 1024 /1024 ) +"MB;")
endif
endif
EndIf
Endif
$Index = $Index + 1
$KeyName = EnumKey("HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"+
"MS Exchange Settings", $Index)
loop
If $Message<>""
SendError($Message)
EndIf
EndFunction



Fixed long line / reformtted code

Refomatted code but not tested, original posters reformats did not reduce the long lines [NTDOC]


Edited by NTDOC (2004-11-30 07:54 PM)