Sign in to follow this  
Followers 0
bmckenzie

Shutdown() not working correctly?

14 posts in this topic

When I tried Shutdown(0 + 4) the machine actually shutdown...this is supposed to be a forced logoff.

This is incorrect behaviour right?

Bill M.

Share this post


Link to post
Share on other sites



Well, 0+4=4, so I'm guessing it's just doing "force" shutdown. I'd guess there's no force logoff.

There is when you call the Win32Shutdown method through WBEM. I want to force the logoff..but I guess I can't.

I suspect this is a bug.

BMac.

Share this post


Link to post
Share on other sites

Well, the math will be performed before the function is executed (someone correct me if I'm wrong), so it is essentially still 4. I wouldn't call it a bug, but maybe a missing feature? :)

Share this post


Link to post
Share on other sites

Well, the math will be performed before the function is executed (someone correct me if I'm wrong), so it is essentially still 4. I wouldn't call it a bug, but maybe a missing feature? :)

Of course it is still 4...I never doubted that. I showed the 0 + 4 to indicate logoff + force.

> maybe a missing feature?

Do you work for Microsoft? ;)

Ah well...no one much cares about bugs these days...a pity.

BMac

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Have you tried just Shutdown(0)... maybe all logoffs are forced?

Edited by dandymcgee

- Dan [Website]

Share this post


Link to post
Share on other sites

Have you tried just Shutdown(0)... maybe all logoffs are forced?

An unsaved notepad will halt Shutdown(0) the XP SP2 system that I tested it on.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Even Run("Shutdown.exe -f") hangs if a doc is unsaved.

I suppose that you could ProcessClose all that you can and then call the logoff.


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Do you work for Microsoft? :)

No... Microsoft doesn't make Autoit, which is what I'm talking about.

Of course it is still 4...I never doubted that. I showed the 0 + 4 to indicate logoff + force.

Maybe you should have been more clear from the start.

Edited by xcal

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Try this:

$i = 0
$ActiveWindows = WinList()
If $ActiveWindows[0] > 0 Then
    Do
        $i = $i + 1
        WinKill($ActiveWindows[$i])
    Until $i = $ActiveWindows[0]
EndIf
Shutdown(0)
Edited by dandymcgee

- Dan [Website]

Share this post


Link to post
Share on other sites

logoff plus force? It logsoff and shutdown. There is no force logoff, but the force is to force shutdown.

Share this post


Link to post
Share on other sites

logoff plus force? It logsoff and shutdown. There is no force logoff, but the force is to force shutdown.

Well that depends on how it is implemented right?

If the underlying code used Win32 calls...which gosh I don't know...why would I expect that on Windows...then:

http://msdn2.microsoft.com/en-us/library/aa394058.aspx

To the other poster....0 + 4 = 4 why would I need to be more explicit about that??

BMac

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

When I tried Shutdown(0 + 4) the machine actually shutdown...

When I tried Shutdown(0 + 4) the machine only logged me off...

...it did not shutdown.

Anybody else have a system that shuts off vs. logs off?

Edit: XP SP2

-MSP-

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

When I tried Shutdown(0 + 4) the machine only logged me off...

...it did not shutdown.

Anybody else have a system that shuts off vs. logs off?

Edit: XP SP2

-MSP-

Interesting...I was testing this on Win2K SP4. So, I guess it may be a Win2K issue. Oh well, non-forced logoffs work for now.

BMac

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