Jump to content

i need a lil help


Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

@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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

: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

        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


bojak71730
            
            
                Posted 
                
            
        
    
    
        


bojak71730
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 16
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            Posted 
            
            
                
                
            
        
    

    

    

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



            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    
        
            
                
                    Moderators
                
                
                
                
            
        
    

    
        
            
                


    
        
    

                
                
                
                
                    
                        

                    
                
            
        
        
            
                


SmOke_N
            
            
                Posted 
                
            
        
    
    
        


SmOke_N
            
        
        
            
                
                    


    
        
    

                    
                        
                    
                    
                        

                    
                
            
            
                Moderators
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 16.3k
                            
                                
                            
                        
                        
                            
                                
                                    
                                        
                                        49
                                
                                    
                                
                            
                        
                    
                
            
            
                

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

            
        
    
    
        



    
        
            
                
                    
                    
                        Moderators
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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.

        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


ChrisL
            
            
                Posted 
                
            
        
    
    
        


ChrisL
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 1.8k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
Mass Spanner!
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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

        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


bojak71730
            
            
                Posted 
                
            
        
    
    
        


bojak71730
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 16
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


BigDod
            
            
                Posted 
                
            
        
    
    
        


BigDod
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Jokers
                
                    
                
            
            
                
                    
                        
                            
                                
                            
                                 7.3k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
RIP: The Mayor of Mirth
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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


        
    

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


bojak71730
            
            
                Posted 
                
            
        
    
    
        


bojak71730
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Members
                
            
            
                
                    
                        
                            
                                
                            
                                 16
                            
                                
                            
                        
                        
                    
                
            
            
                

            
        
    
    
        



    
        
            
                
                    
                        Author
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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


            
        

        

        
    

    

    




    Link to comment
    
        
    
    
    

    
    Share on other sites
    

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    


    
    More sharing options...

    


    

                    
                    
                    
                

                    

                    
                    





    

    

    
        
            
                


    
        
    

                
                
                    
                        

                    
                
            
        
        
            
                


ChrisL
            
            
                Posted 
                
            
        
    
    
        


ChrisL
            
        
        
            
                
                    


    
        
    

                    
                    
                        

                    
                
            
            
                Active Members
                
            
            
                
                    
                        
                            
                                
                            
                                 1.8k
                            
                                
                            
                        
                        
                    
                
            
            
                

    
    
        
Mass Spanner!
    
    

            
        
    
    
        



    
        
            
                
                    
                    
                    
                    
                    
                
            
            
                
                    
                    
                        
                        
                            Share
                        
                        
                        
                        
                        
                            
                                
                            
                            
                            
                            
                            
                            
                        
                    
                
                
            
        

        
            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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • Moderators

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.

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...