Sign in to follow this  
Followers 0
jp10558

Determine if LogMeIn has someone logged in?

5 posts in this topic

I've tried:

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.8.1
 Author:         

 Script Function:
    Log out of Windows on disconnect of LogMeIn.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
If @UserName = "Administrator" Then
Else
    While WinExists("LogMeIn")
        Sleep(10000)
    WEnd
    Shutdown(0)
EndIf

but that just loops even when the little window logmein uses to tell you someone's remote controlling the system is gone.

Any other ideas?

Share this post


Link to post
Share on other sites



I've tried:

#cs ----------------------------------------------------------------------------
 
  AutoIt Version: 3.2.8.1
  Author:        
 
  Script Function:
     Log out of Windows on disconnect of LogMeIn.
 
 #ce ----------------------------------------------------------------------------
 
; Script Start - Add your code below here
 If @UserName = "Administrator" Then
 Else
     While WinExists("LogMeIn")
         Sleep(10000)
     WEnd
     Shutdown(0)
 EndIf

but that just loops even when the little window logmein uses to tell you someone's remote controlling the system is gone.

Any other ideas?

http://www.autoitscript.com/autoit3/docs/f...ons/WinList.htm

Try use this function when you mean that the window should not exists anymore... (Remember it could be hidden). This shows a list of all the windows that exists.


Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Share this post


Link to post
Share on other sites

Great, that works. The major issue I have now is that if a user closes that window, it logs them out. I don't suppose anyone using LogMeIn Free knows some better way to determine if someone is connected than just the dialog that is popped up?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

So I've come up with this:

; Script Start - Add your code below here
#include <file.au3>
Dim $logfile
If @UserName = "Administrator" Then
Else    
    Do
        Sleep(10000)
        _FileReadToArray(@ProgramFilesDir & "\LogMeIn\LogMeIn.log",$logfile)
    Until StringInStr($logfile[$logfile[0]-1],"Logged Out.")
    Shutdown(0)
EndIf

that seems to do what I want. Any suggestions for improvement or gotchas I may have missed?

Also, any idea why formulating the above as

If NOT @UserName = "Administrator" then
fails? Too C++ish? Should it be
If @Username Not "Administrator"
...? Edited by jp10558

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  
Followers 0