Jump to content

Recommended Posts

Posted (edited)

Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')

Run('calc')

Run('Notepad')

Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')

I made this script and what it does is it opens up internet explore calculator and notepad and yahoo messenger now what i wana figure out is how would i close all of these just by pushing a simple command on my keyboard cause i want all of these to close at once

Edited by bojak71730
Posted

Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')

Run('calc')

Run('Notepad')

Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')

I made this script and what it does is it opens up internet explore calculator and notepad and yahoo messenger now what i wana figure out is how would i close all of these just by pushing a simple command on my keyboard cause i want all of these to close at once

Look at the example for ProcessClose in the help file and build it into your function for when the button is pressed.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

Try this

HotKeySet("!{F9}", "Close");alt + F9 to close

$Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
$Calc = Run('calc')
$NotePad = Run('Notepad')
$Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')


Func Close()
    ProcessClose ($Explorer)
    ProcessClose ($Calc)
    ProcessClose ($NotePad)
    ProcessClose ($Yahoo)
EndFunc
  • Moderators
Posted (edited)

HotKeySet("!{F9}", "Close");alt + F9 to close

Dim $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
Dim $Calc = Run('calc.exe')
Dim $NotePad = Run('Notepad.exe')
Dim $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')


Func Close()
   If ProcessExists($Explorer) Then ProcessClose ($Explorer)
    If ProcessExists($Calc) Then ProcessClose ($Calc)
    If ProcessExists($NotePad) Then ProcessClose ($NotePad)
    If ProcessExists($Yahoo) Then ProcessClose ($Yahoo)
EndFunc

@ChrisL :lmao:

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

  • Moderators
Posted

@ChrisL & SmOke_N

A loop sounds good to keep the script running for HotKeySet(). :lmao:

Lmao!! No doubt... When I edited, I thought I put one in!!

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted

Lmao!! No doubt... When I edited, I thought I put one in!!

Daydreaming again. :lmao:;)o:)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

well these codes dont work for me i had one code that open each program 3 times and when i went to use the hot key it closed only 2 of them instead of all of them

Posted (edited)

:lmao:

Loooooop

Oh yeah.. forgot about that part!


HotKeySet("!{F9}", "Close");alt + F9 to close

$Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
$Calc = Run('calc')
$NotePad = Run('Notepad')
$Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')
$IamAnArse = 1

While $IamAnArse
Sleep (1000)
Wend

Func Close()
    ProcessClose ($Explorer)
    ProcessClose ($Calc)
    ProcessClose ($NotePad)
    ProcessClose ($Yahoo)
    $IAmAnArse = 0
EndFunc

[\Code]


            
                


    Edited  by ChrisL
    
    

            
        

        

        
            

    
        

        
            
[u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3  ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire

        
    

        
    

    
    

    

                    
                    
                        
                            
  




     (adsbygoogle = window.adsbygoogle || []).push({});

  

                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


bojak71730
            
            
                Posted 
                
            
        
    
    
        


bojak71730
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 16
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            
LoooooopOh yeah.. forgot about that part!can u rewrite the code cause i wana make this badboywork right



            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


SmOke_N
            
            
                Posted 
                
            
        
    
    
        


SmOke_N
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 16.3k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        49
                                
                                    
                                
                            
                        
                    
                
            
            
                

    
    
        
It's not what you know ... It's what you can prove!
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            
can u rewrite the code cause i wana make this badboywork right ... Err that's pretty basic AutoIt 101 , and you want HIM to re-write it?  Have you tried yourself?


            
        

        

        
            

    
        

        
            
    Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

        
    

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


ChrisL
            
            
                Posted 
                
            
        
    
    
        


ChrisL
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 1.8k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
Mass Spanner!
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            can u rewrite the code cause i wana make this badboywork rightSee above


            
        

        

        
            

    
        

        
            
[u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3  ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire

        
    

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


bojak71730
            
            
                Posted 
                
            
        
    
    
        


bojak71730
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 16
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            it open everything twice cept yahoo messenger and the things it did open twice it only closed one of them and before i added this code it closed yahoo messenger and it dont even do that no more


            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


BigDod
            
            
                Posted 
                
            
        
    
    
        


BigDod
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Jokers
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 7.3k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
RIP: The Mayor of Mirth
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            it open everything twice cept yahoo messenger and the things it did open twice it only closed one of them and before i added this code it closed yahoo messenger and it dont even do that no morePost your whole code so we can see if you did something wrong


            
        

        

        
            

    
        

        
            
    
    Time you enjoyed wasting is not wasted time ......T.S. Elliot
    Suspense is worse than disappointment................Robert Burns
    God help the man who won't help himself, because no-one else will...........My Grandmother


        
    

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


bojak71730
            
            
                Posted 
                
            
        
    
    
        


bojak71730
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 16
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
Run('calc')
Run('Notepad')
Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')
HotKeySet("!{F9}", "Close");alt + F9 to close

$Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
$Calc = Run('calc')
$NotePad = Run('Notepad')
$Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')
$IamAnArse = 1

While $IamAnArse
Sleep (1000)
Wend

Func Close()
ProcessClose ($Explorer)
ProcessClose ($Calc)
ProcessClose ($NotePad)
ProcessClose ($Yahoo)
$IAmAnArse = 0
EndFunc


            
        

        

        
    

    
    

    

                    
                    
                        
                    
                    
                

                    

                    
                    






    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


ChrisL
            
            
                Posted 
                
            
        
    
    
        


ChrisL
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 1.8k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
Mass Spanner!
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
           
           Posted 
           
            
            
                
                
            
        
    

    

    

    
        
        
            Using Smoke_N's Dims and If's, I dont have yahoo but the rest work fine for me using this!


HotKeySet("!{F9}", "Close");alt + F9 to close

Dim $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
Dim $Calc = Run('calc.exe')
Dim $NotePad = Run('Notepad.exe')
Dim $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')
$IamAnArse = 1

While $IAmAnArse
Sleep (1000)
Wend

Func Close()
   If ProcessExists($Explorer) Then ProcessClose ($Explorer)
    If ProcessExists($Calc) Then ProcessClose ($Calc)
    If ProcessExists($NotePad) Then ProcessClose ($NotePad)
    If ProcessExists($Yahoo) Then ProcessClose ($Yahoo)
    $IamAnArse = 0
EndFunc
Posted

Using Smoke_N's Dims and If's, I dont have yahoo but the rest work fine for me using this!

HotKeySet("!{F9}", "Close");alt + F9 to close

Dim $Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
Dim $Calc = Run('calc.exe')
Dim $NotePad = Run('Notepad.exe')
Dim $Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')
$IamAnArse = 1

While $IAmAnArse
Sleep (1000)
Wend

Func Close()
   If ProcessExists($Explorer) Then ProcessClose ($Explorer)
    If ProcessExists($Calc) Then ProcessClose ($Calc)
    If ProcessExists($NotePad) Then ProcessClose ($NotePad)
    If ProcessExists($Yahoo) Then ProcessClose ($Yahoo)
    $IamAnArse = 0
EndFunc
Works for me to.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

it opens everything twice still cept yahoo messenger and it only closes 1 of everything else when there is two of them open and it still isnt touching yahoo messenger its as if yahoo isnt even there

  • Moderators
Posted

It runs twice, because your telling it to run twice:

you have:

Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
Run('calc')
Run('Notepad')
Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')

Then you have:

$Explorer = Run('C:\Program Files\Internet Explorer\IEXPLORE.EXE')
$Calc = Run('calc')
$NotePad = Run('Notepad')
$Yahoo = Run('"C:\Program Files\Yahoo!\Messenger\YPager.exe"')
$IamAnArse = 1

Just because there is a variable in front of the 2nd Run() sets, doesn't mean that it won't run them. Take out the first set of Run()'s

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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
×
×
  • Create New...