#NoTrayIcon #include <GUIConstantsEx.au3> #include <File.au3> #include <Date.au3> #include <Inet.au3> Global $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Global $Basepath="D:\Base\” ; , ;, 1. If ProcessExists("1cv8.exe") or ProcessExists("chdbfl.exe") Then Msgbox(0,"!", "1c , ") Exit EndIf ;, , if FileExists ($Basepath&"_$NEW$_.1CD") Then MSGbox(0,"!", " ! ") Exit EndIf ; , If not FileExists ($Basepath&"1Cv8.1CD") Then Msgbox(0,"!", " !") Exit EndIf ;, $hgui = GUICreate(" " , 200, 200) GUICtrlCreateLabel(" ",2,2) GUICtrlCreateLabel(" 30 ",2,22) GUICtrlCreateLabel(" ? ",2,42) $yes = GUICtrlCreateButton("", 5, 150, 70, 25) $no= GUICtrlCreateButton("", 75, 150, 70, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE GUIDelete() Exit Case $msg = $yes GUIDelete() _check () ExitLoop Case $msg = $no GUIDelete() Exit EndSelect WEnd ; func _check () $sTitle=" " ProgressOn(" ", " ", "0%",-1,-1,18) run ("C:\Program Files\1cv81\bin\chdbfl.exe","", @SW_HIDE,7) WinWait($sTitle) local $size = filegetsize($Basepath&"1Cv8.1CD") ;! ControlSend($sTitle,"", "V8FormElement9",$Basepath&"1Cv8.1CD") ControlClick($sTitle,"", "V8FormElement8") ControlClick($sTitle,"", "V8FormElement7","left",2) $filename = $Basepath&"\1Cv8.1CD" local $size1 =0 ; While 1 $size1 = filegetsize($Basepath&"_$NEW$_.1CD") $perc=round(($size1/$size)*100) ProgressSet($perc, ", . "& $perc & "%") sleep (1500) ;, ; If not FileInUse($filename) and not FileExists ($Basepath&"\_$NEW$_.1CD") Then ExitLoop EndIf WEnd sleep(5000) ; , ; - ! WinSetState ( $sTitle, "", @SW_SHOW ) WinSetOnTop($sTitle, "", 1) WinActivate($sTitle, "") WinWaitActive($sTitle) ControlClick($sTitle,"", "V8FormElement4") sleep(50) ControlSend($sTitle,"", "V8FormElement4","^{home}") sleep(50) ControlSend($sTitle,"", "V8FormElement4","+^{end}") sleep(50) ControlSend($sTitle,"", "V8FormElement4","^{ins}") sleep(50) $text = ClipGet() ControlClick($sTitle,"", "V8FormElement6","left",2) ProgressSet(100, "100%", " ") sleep (500) ProgressOff() ; -, , . ; e-mail ; Outlook Express. $sender = RegRead("HKEY_CURRENT_USER\Software\Microsoft\ _ Internet Account Manager\Accounts\00000001","SMTP Email Address") $sendername = RegRead("HKEY_CURRENT_USER\Software\Microsoft\ _ Internet Account Manager\Accounts\00000001","SMTP Display Name") If not FileExists($Basepath&"check.Log") then _FileCreate($Basepath&"\check.Log") FileWrite ($Basepath&"check.Log", _NowCalc()&@CRLF ) If $text <> "" Then FileWrite ( $Basepath&"check.Log", " :"&@CRLF) FileWrite ( $Basepath&"check.Log", $text&@CRLF) FileWrite ( $Basepath&"check.Log", " .."&@CRLF) ; smtp. -, If Ping("smtp-server") <> 0 then if $sender = "" or $sendername="" Then MSGbox(0,"!", " , !") Else email($sender, $sendername,$text) EndIf endif ; , Else FileWrite ( $Basepath&"check.Log", " "&@CRLF) EndIf $hgui = GUICreate(" " , 200, 200) GUICtrlCreateLabel(" ",2,2) $ok = GUICtrlCreateButton("", 5, 150, 70, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE or $msg=$1 GUIDelete() Exit EndSelect WEnd EndFunc Func FileInUse($filename) $handle = FileOpen($filename, 1) $result = False if $handle = -1 then $result = True FileClose($handle) return $result EndFunc func email($sender, $sendername,$text) local $array[1] $array[0]=$text $t=_INetSmtpMail("smtpserver", $sendername,$sender, "[helpdesk@domain.com](mailto:helpdesk@domain.com)", _ " " ,$array,"EHLO " & @ComputerName,-1 ) $error=@error if $t <> 1 Then FileWrite ( $Basepath&"check.Log", " e-mail "&$sendername& " "&$sender&@CRLF) FileWrite ( $Basepath&"check.Log", " "&$error&@CRLF) Else FileWrite ( $Basepath&"check.Log", "email "&@CRLF) EndIf EndFunc ;---------------------------------------------------------------------------------------------------------- ; Com Error Handler ;---------------------------------------------------------------------------------------------------------- Func MyErrFunc() Local $HexNumber Local $strMsg $HexNumber = Hex($oMyError.Number, 8) $strMsg = " " & $HexNumber & @CRLF $strMsg &= " " & $oMyError.WinDescription & @CRLF $strMsg &= ": " & $oMyError.ScriptLine & @CRLF FileWrite ( $Basepath&"check.Log", " -: "&$strMsg) FileWrite ( $Basepath&"check.Log", "e-mail "& @CRLF) SetError(1) Endfunc