Mitt Posted December 5, 2008 Share Posted December 5, 2008 (edited) I am trying to write a script that prompts the user with a message box warning them about saving their files to a removable disk before shutting down the computer and need a way to launch the shutdown dialog (the standard shutdown screen from the shutdown button on the start menu) after the user presses ok to the message box. Is there a way to call that shutdown dialog from within and AutoIt script? The one thing I found was a way to launch the dialog from VBscript or VB.net vb script: <script language="VBScript"> function fnShellShutdownWindowsVB() dim objShell set objShell = CreateObject("Shell.Application") objShell.ShutdownWindows set objShell = nothing end function </script> Visual Basic: Private Sub fnShellShutdownWindowsVB() Dim objShell As Shell Set objShell = New Shell objShell.ShutdownWindows Set objShell = Nothing End Sub Edited December 5, 2008 by Mitt Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 5, 2008 Share Posted December 5, 2008 Func fnShellShutdownWindowsVB() Local $objShell = ObjCreate("Shell.Application") $objShell.ShutdownWindows EndFunc Did you ever think of that? Link to comment Share on other sites More sharing options...
martin Posted December 5, 2008 Share Posted December 5, 2008 Func fnShellShutdownWindowsVB() Local $objShell = ObjCreate("Shell.Application") $objShell.ShutdownWindows EndFunc Did you ever think of that?Or you could use the inbuilt function ShutDown. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Mitt Posted December 5, 2008 Author Share Posted December 5, 2008 Richard, no I didn't think of that. I am very new to AutoIt and don't know all the ins and outs, hence the reason I asked in the forums. Thank you for your reply, although a little it seemed to be a little rude. You don't have to be a prick when answering questions that might be simple to you. Link to comment Share on other sites More sharing options...
Richard Robertson Posted December 5, 2008 Share Posted December 5, 2008 (edited) Martin, Shutdown() doesn't invoke the shutdown dialog. That was what the user asked for. Mitt, sorry for the way I answered earlier. I'm usually a nice guy. It's nothing against you. Edited December 5, 2008 by Richard Robertson Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now