Jump to content

Problem with Shutdown(0) failing


jp10558
 Share

Recommended Posts

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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...