Sign in to follow this  
Followers 0
jp10558

Problem with Shutdown(0) failing

8 posts in this topic

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

Share this post


Link to post
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]

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Alternatively, is there an alternate way to log out of windows than Shutdown(0), aside from sending the keystrokes?

Share this post


Link to post
Share on other sites

RunWait("shutdown -l")

Share this post


Link to post
Share on other sites

RunWait("shutdown -l")

Wouldn't I want to not wait? That is, Run(foo) ... else the script is there maybe hanging up windows logout?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Well, the "shutdown -l" worked, so I'm good. No idea what's up with the Shutdown(0) function there, but hey. Thanks!

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