Jump to content

Recommended Posts

Posted

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?!

Posted

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]

Posted

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.
Posted

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.

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
×
×
  • Create New...