Discussion:
Shutdown explorer not interactively ?
(too old to reply)
Vilius Mockûnas
2010-03-06 18:10:01 UTC
Permalink
Raw Message
Hello,

The proper way to shut down explorer interactively:
1. Display classic shutdown dialog(Alt+F4)
2. Use Ctrl+Alt+Shift+"Push Cancel button with mouse"

I want to do exactly the same thing only not interactively - by using batch
script, vbs script(wsh), wmi or whatever method.
(Of course I can always terminate explorer process but I don't want to do
that)
Possible to do that ?

thanks
Vilius
Ivo Beltchev
2010-03-06 18:41:54 UTC
Permalink
Raw Message
I have found this some time ago, but haven't tried it myself:
http://www.replicator.org/node/100
Post by Vilius Mockûnas
Hello,
1. Display classic shutdown dialog(Alt+F4)
2. Use Ctrl+Alt+Shift+"Push Cancel button with mouse"
I want to do exactly the same thing only not interactively - by using batch
script, vbs script(wsh), wmi or whatever method.
(Of course I can always terminate explorer process but I don't want to do
that)
Possible to do that ?
thanks
Vilius
Jonathan de Boyne Pollard
2010-03-06 18:36:52 UTC
Permalink
Raw Message
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:***@TK2MSFTNGP06.phx.gbl" type="cite">
<p wrap="">I want to do exactly the same thing only not interactively<br>
</p>
</blockquote>
<p>Then the <code>ExitWindowsEx()</code> function is your friend.</p>
</body>
</html>
Marcello
2010-05-11 14:17:01 UTC
Permalink
Raw Message
Post by Vilius Mockûnas
Of course I can always terminate explorer
process but I don't want to do that
Why not?
Post by Vilius Mockûnas
I want to do exactly the same
If you really want to do EXCACTLY the same, i guess you have to use Sendkeys:

'-----MyScript.vbs-----
set o = CreateObject("WScript.Shell")

o.SendKeys "%{F4}"
WScript.Sleep 1000
o.SendKeys "{TAB}"
WScript.Sleep 1000
o.SendKeys "{TAB}"
WScript.Sleep 1000
o.SendKeys "%+^{ENTER}"
'--------------------

Lg
Marcello

Loading...