Jump to content

_ShutDown (UDF)


AutoItKing
 Share

Recommended Posts

Here's a UDF I made that closes all windows and then either logs off, shuts down, closes all windows and then leaves a few open, or just close all windows.

;===============================================================================
;
; Description:      Close all windows according to $sd_method
; Syntax:           _ShutDown($sd_method, $sd_leaveopen)
; Parameter(s):     $sd_method - =====================================================
;                         method 0- close all windows and log off
;                         method 1- close all windows and shutdown
;                         method 2- close all windows and reboot
;                         method 3- close all windows
;                         method 4- close all windows except for $sd_leaveopen
;                         =====================================================
;               $sd_leaveopen - "Window Title|Another|and one more"
;
; Requirement(s):   $sd_method
; Return Value(s):  On Success - None
;                   On Failure - None
; Author(s):        AutoItKing <bendudefu [at] aim [dot] com> and Danny35d
; Note(s):          Use with caution!
;
;===============================================================================

_ShutDown.au3 Previous downloads: 500+

_ShutDown_test.au3

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

  • 2 months later...

Wow, 155 downloads!

" _ShutDown.au3 ( 2.91k ) Number of downloads: 155"

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Wow, 155 downloads!

" _ShutDown.au3 ( 2.91k ) Number of downloads: 155"

Now it's at 174!

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

Shame, you missed 18 opprotunities to increase your post count! And now you've missed 15 more! Work on that, will you?

:D

What?
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

You'll learn, I wasn't this good when I started. (believe me :D )

And now on top of all that I'm learing PHP and C++!

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

FireFox and Opera don't work for me, it's the firewall, and I'm not the admin.

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

FireFox and Opera don't work for me, it's the firewall, and I'm not the admin.

How does a firewall prevent you from running Firefox?

AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)
Link to comment
Share on other sites

How does a firewall prevent you from running Firefox?

Program acsess and an internet firewall, only ie can go online! As in, only ie can get onto the internet, all others are blocked, I can run them though.

I'm pretty good with html. You need it for the internet! (but I still use an editor for the big sites!)

<font color=CadetBlue>I love HTML!</font>

http://www.w3schools.com/html/

This is where I learned html. And this is where I learned php. lol

If you want to learn more php, I'm there for ya!

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

@AutoItKing I like the UDF I did some changes, I hope you dont mind..

#include-once

; ------------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:    English
; Description:  Functions that assist with closing windows.
;
; ------------------------------------------------------------------------------


;===============================================================================
;
; Description:    Close all windows according to $sd_method
; Syntax:          _ShutDown($sd_method, $sd_leaveopen, $sd_leaveopen2, $sd_leaveopen3)
; Parameter(s):  $sd_method - =====================================================
;                                method 0- close all windows and log off
;                                method 1- close all windows and shutdown
;                                method 2- close all windows and reboot
;                                method 3- close all windows
;                                method 4- close all windows except for $sd_leaveopen
;                                =====================================================
;                   $sd_leaveopen - "Window Title"
;                   $sd_leaveopen2 - "Window Title"
;                   $sd_leaveopen - "Window Title"
;
; Requirement(s):   $sd_method
; Return Value(s):  On Success - None
;                  On Failure - None
; Author(s):        AutoItKing <bendudefu [at] aim [dot] com>
; Note(s):        Use with caution!
;
;===============================================================================

Func _ShutDown($sd_method, $sd_leaveopen = "Program Manager", $sd_leaveopen2 = "Program Manager", $sd_leaveopen3 = "Program Manager")   
    $i=1
    $sd_windows = WinList()
    While 1
        If $sd_windows[$i][0] <> "" AND BitAnd( WinGetState($sd_windows[$i][1]), 2 ) AND $sd_windows[$i][0] <> "Program Manager" Then
            If $sd_method == 4 And (StringInStr($sd_windows[$i][0], $sd_leaveopen) <> 0 Or StringInStr($sd_windows[$i][0], $sd_leaveopen2) <> 0 Or StringInStr($sd_windows[$i][0], $sd_leaveopen3) <> 0) Then
                
            Else 
                WinClose($sd_windows[$i][0])
            EndIf
        EndIf
        $i += 1
        If $i == $sd_windows[0][0] Then
            If $sd_method == 0 Or $sd_method == 1 Or $sd_method == 2 Then Shutdown(Int($sd_method))
            ExitLoop
        EndIf
    Wend            
EndFunc

Added method 2- close all windows and reboot

Edited by Danny35d
AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
Link to comment
Share on other sites

Not bad, it's a lot shorter I must say. And I like the reboot.

http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
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
 Share

  • Recently Browsing   0 members

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