Jump to content
Sign in to follow this  

Suggestion/Help for my script

Recommended Posts


Hello AutoIt programers!

I'm new in this programing language and i don't have good programing skills.

I have search/study the forum and i have made i script.

I need some help and sugestion for my script.

Whow script work: it's write in a log file the log-in time (when windows start) and log-off time (when windows shutdown)

I have create a funtion to backup log file from last month every new month (until 4th of month). The function work separated but in

when i put togheter don't work properly. When backup function it's call the file it's backup after the current log-in time is write

(the log-in time of day when back-up it's made apear in back-up file no in new file).

And another issue :blink: i don't know how to implemant this function Log-off : http://www.autoitscript.com/forum/index....wtopic=19370&st=40&p=186785&#entry186785

I hope somebody can help me


In attachament i put my script


Share this post

Link to post
Share on other sites

Global Const $ENDSESSION_CLOSEAPP = 0x00000001
Global Const $ENDSESSION_CRITICAL = 0x40000000
Global Const $ENDSESSION_LOGOFF = 0x80000000

Global Const $WM_QUERYENDSESSION = 0x0011

GUICreate("You need a GUI to register messages...")

GUIRegisterMsg($WM_QUERYENDSESSION, "InterceptShutdown")

While GUIGetMsg() <> -3

Func InterceptShutdown($hWnd, $msg, $w, $l)
        MsgBox(0, "", "Logging Off")
        MsgBox(0, "", "Shutting down")
EndFunc  ;==>InterceptShutdown

Edited by Mat

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.