jp10558 Posted February 27, 2008 Share Posted February 27, 2008 I'm trying to get a script that logs out a user if LogMeIn disconnects to work on my second virtual machine. I have it working just fine on one, but on number 2, it never logs out...? #include <file.au3> Dim $logfile If @UserName = "Administrator" Then MsgBox(0,"Notice","You are logged in as Administrator."&@CRLF&"You must LOG OUT manually!") Else Do Sleep(10000) AutoItSetOption ( "TrayIconHide" ,1 ) _FileReadToArray(@ProgramFilesDir & "\LogMeIn\LogMeIn.log",$logfile) Until StringInStr($logfile[$logfile[0]-1],"Logged Out.") OR StringInStr($logfile[$logfile[0]-1],"Watchdog applet disconnected." ) OR StringInStr($logfile[$logfile[0]-1],"0x19731002") MsgBox(0,"Status",Shutdown(0)) EndIf Nothing happens, I get code 0, or failure - but that particular function doesn't give me any info. I also tried Shutdown(4) but I'm not clear if that is a valid option, nor what ought to occur with that, but I still get 0 returned, and no log off goodness. Any ideas?! Link to comment Share on other sites More sharing options...
herewasplato Posted February 28, 2008 Share Posted February 28, 2008 What flavor if VM are you running? MS Virtual PC? IBM? VMware? ...... What OS are you running within the first VM? What OS are you running within the second VM? XP SP2? W2K? W98SE? Running this one line... MsgBox(0,"Status",Shutdown(0)) ... from within each OS listed above using the free :-) MS Virtual PC 2007 works as expected. I don't know why it is not working for you - maybe if you answer those questions above, someone will stop by to help you out. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
jp10558 Posted February 28, 2008 Author Share Posted February 28, 2008 What flavor if VM are you running?MS Virtual PC?IBM?VMware?......What OS are you running within the first VM?What OS are you running within the second VM?XP SP2?W2K?W98SE?Running this one line...MsgBox(0,"Status",Shutdown(0))... from within each OS listed above using the free :-) MS Virtual PC 2007 works as expected.I don't know why it is not working for you - maybe if you answer those questions above, someone will stop by to help you out.Sorry, I'm running VMWare Server 1.04, Both are XPSP2 OSs. Link to comment Share on other sites More sharing options...
jp10558 Posted February 28, 2008 Author Share Posted February 28, 2008 Alternatively, is there an alternate way to log out of windows than Shutdown(0), aside from sending the keystrokes? Link to comment Share on other sites More sharing options...
weaponx Posted February 28, 2008 Share Posted February 28, 2008 RunWait("shutdown -l") Link to comment Share on other sites More sharing options...
jp10558 Posted February 28, 2008 Author Share Posted February 28, 2008 RunWait("shutdown -l")Wouldn't I want to not wait? That is, Run(foo) ... else the script is there maybe hanging up windows logout? Link to comment Share on other sites More sharing options...
weaponx Posted February 28, 2008 Share Posted February 28, 2008 Wouldn't I want to not wait? That is, Run(foo) ... else the script is there maybe hanging up windows logout?Who knows. How can Shutdown() have a return value? Its a mystery. Link to comment Share on other sites More sharing options...
jp10558 Posted February 29, 2008 Author Share Posted February 29, 2008 Well, the "shutdown -l" worked, so I'm good. No idea what's up with the Shutdown(0) function there, but hey. Thanks! Link to comment Share on other sites More sharing options...
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