Jump to content

Recommended Posts

Posted

I know this is a standard practice, but is this actually necessary in a situation where you are shutting down the computer?

dim objShellset objShell = CreateObject("shell.application")objshell.ShutdownWindowsset objShell = nothing
^ above, setting objShell to nothing... not actually necessary because either the shutdown sequence will kill the application/script or the fact that the script immediately ends?

Just a conversation topic. Code sample from here:

http://www.msfn.org/board/topic/174021-startisback-10/page-9?p=1105751#entry1105751


Posted

Shell.ShutdownWindows doesn't shut down windows, it "[d]isplays the Shut Down Windows dialog box. This is the same as clicking the Start menu and selecting Shut Down."

So if the dialog is cancelled, the call will return. Therefore the object should be released as in your sample code (same as on MSDN at above link).

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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