jp10558 Posted January 21, 2008 Posted January 21, 2008 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?
Shevilie Posted January 21, 2008 Posted January 21, 2008 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
jp10558 Posted January 22, 2008 Author Posted January 22, 2008 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?
ptrex Posted January 22, 2008 Posted January 22, 2008 @allA simpler way would be to Monitor the logfile for time to time.And check if someone has logged in or not.C:\Program Files\LogMeIn\LogMeIn.logRegards,ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New
jp10558 Posted January 22, 2008 Author Posted January 22, 2008 (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 January 22, 2008 by jp10558
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now