Hello! More than 6 months of using your scripts(Service_UDF v.1),thanks for the good work. And, too,was faced with the script hangs.I wrote a vbs-script that kill the process and start the service, when autoit-script hangs. But I wanted the service work for a long time without freezing. I would like to offer my solution to this problem.I saw that the new version(Service_UDF v.2) and yesterday modified ServiceExample.au3,I created a pause function(see below).The script no longer hang, is working half day.I will test further and write about the results later. Func _Sleep($delay) logprint("Pause " & $delay / 1000 & " seconds...") Local $dll = DllOpen("kernel32.dll") Local $result = DllCall($dll, "none", "Sleep", "dword", $delay) DllClose($dll) EndFunc ;==>_Sleep Best regards, Dmitrii. ServiceExample.v2.au3