Sign in to follow this  
Followers 0
bojak71730

i need a lil help

24 posts in this topic

#1 ·  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

Share this post


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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


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

Share this post


Link to post
Share on other sites

#5 ·  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

[center]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.[/center]

Share this post


Link to post
Share on other sites

@ChrisL & SmOke_N

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

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Daydreaming again. :lmao:;)o:)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#10 ·  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
  


        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
bojak71730   

    
        
    
             0
    
        
    

        
            
                Seeker
            
            

            
                

    
        
    

            
            Members
            
            
                

    
        
    
             0
    
        
    

                16 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #11 · 
            Posted 
            
            
            
        
    

    


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



            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
SmOke_N   

    
        
    
             178
    
        
    

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

            
                

    
        
    

            
            Moderators
            
                
            
            
                

    
        
    
             178
    
        
    

                16,119 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #12 · 
            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?


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
            




  
  
    [center]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.[/center]
  


        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
ChrisL   

    
        
    
             9
    
        
    

        
            
                Mass Spanner!
            
            

            
                

    
        
    

            
            Active Members
            
            
                

    
        
    
             9
    
        
    

                1,750 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #13 · 
            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
  


        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
bojak71730   

    
        
    
             0
    
        
    

        
            
                Seeker
            
            

            
                

    
        
    

            
            Members
            
            
                

    
        
    
             0
    
        
    

                16 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #14 · 
            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


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
BigDod   

    
        
    
             504
    
        
    

        
            
                The Mayor of Mirth
            
            

            
                

    
        
    

            
            Jokers
            
                
            
            
                

    
        
    
             504
    
        
    

                7,315 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #15 · 
            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


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
            




  
  
    Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.Time you enjoyed wasting is not wasted time ......T.S. ElliotSuspense is worse than disappointment................Robert BurnsGod help the man who won't help himself, because no-one else will...........My Grandmother

  


        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
bojak71730   

    
        
    
             0
    
        
    

        
            
                Seeker
            
            

            
                

    
        
    

            
            Members
            
            
                

    
        
    
             0
    
        
    

                16 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #16 · 
            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


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
ChrisL   

    
        
    
             9
    
        
    

        
            
                Mass Spanner!
            
            

            
                

    
        
    

            
            Active Members
            
            
                

    
        
    
             9
    
        
    

                1,750 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #17 · 
            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

Share this post


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


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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


[center]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.[/center]

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