Sign in to follow this  
Followers 0
AutoItKing

_ShutDown (UDF)

30 posts in this topic

#1 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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.

:mellow::):):o

hey, autoit king, this script very sweet.. thanks again.

Edited by slightly_abnormal

Share this post


Link to post
Share on other sites

Simple and very useful!

Cheers.. :)

Share this post


Link to post
Share on other sites

No doubt! :)

wow, COOL MAN, A+

Could you add

process control too

wait, Is there a way to get process list and if so the user name that it is in???


[center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center]

Share this post


Link to post
Share on other sites

Now it's at 174!

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

:D


My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Nice one... you make me feel bad because i cant code as good as you :D

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

... and yet you still use IE how sad :D

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

i know some VERY, VERY basic php, and i mastered html at age 9 :D

I won't step near c or java though

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

#19 ·  Posted (edited)

@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

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