Sign in to follow this  
Followers 0
mrbloody369

Run() & ProcessClose Question

4 posts in this topic

Question 1)

I can't get the RUN() to open my VLC.exe, and I searched the help file and the forum and could not find an example that worked for me..

EXAMPLE:

#NoTrayIcon
#include <IE.au3>
#include <GUIConstants.au3>
$MainWin = GUICreate("My Head huts" , 400 , 170) 
$VNCButton = GUICtrlCreateButton ("VNC", 325, 140 , 34)
GUISetState () 

While 1
    $msg = GUIGetMsg()
    If $msg = $VNCButton Then
        Run("vlc.exe","C:\Documents and Settings\username\My Documents\vlc-0.8.6b-win32\vlc-0.8.6b")
    ;~~grrr ^^^
    EndIf
Wend

>"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Program Files\AutoIt3\test\Help-Demos\test2.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams 
+>11:53:29 Starting AutoIt3Wrapper v.1.9.2
>Running AU3Check (1.54.7.0)  from:C:\Program Files\AutoIt3
+>11:53:29 AU3Check ended.rc:0
>Running:(3.2.4.9):C:\Program Files\AutoIt3\autoit3.exe "C:\Program Files\AutoIt3\test\Help-Demos\test2.au3"    
C:\Program Files\AutoIt3\test\test2.au3 (35) : ==> Unable to execute the external program.: 
Run("vlc.exe","C:\Documents and Settings\username\My Documents\vlc-0.8.6b-win32\vlc-0.8.6b") 
The system cannot find the file specified.


->11:55:26 AutoIT3.exe ended.rc:1
+>11:55:26 AutoIt3Wrapper Finished
>Exit code: 1   Time: 117.349

Question 2)

I been makeing a panic button for my GUI at work that shuts down every thing, that the Boss doesn't need to see open on my pc. I got it killing all the programs I want except it will not close mutable windows of IEXPLORE.exe.. If tried ProcessClose(),ProcessExists() and ProcessClose() with sleep(5~30) between all of them. It work once by miracle but never work after that test . :) Am I going about this all wrong?

Example:

#NoTrayIcon
#include <IE.au3>
#include <GUIConstants.au3>
$MainWin = GUICreate("My Text Sender" , 400 , 170)  
$PanicButton = GUICtrlCreateButton ("PANIC", 360 , 140 , 40) 
GUISetState () 
While 1
    $msg = GUIGetMsg()
                If $msg = $PanicButton Then
        ProcessClose("VLC.exe")
        Sleep(5)
        ProcessClose("SciTE.exe")
        Sleep(5)
        ProcessExists("IEXPLORE.exe")
        Sleep(30)
        ProcessClose("IEXPLORE.exe")
        Sleep(30)
        ProcessClose("IEXPLORE.exe")
        Sleep(30)
        ProcessClose("IEXPLORE.exe")
               Endif
               If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

Thanks for any and all help.

Mr B.


Favorite Quotes"If you apply your mind you can create any thing you can dream of" "Any thing can get done by simply click of a button"

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

try this to open just add this:

Run('C:\Documents and Settings\username\My Documents\vlc-0.8.6b-win32\vlc-0.8.6b\vlc.exe')

and for close

While 1

$msg = GUIGetMsg()

If $msg = $PanicButton Then

processclose("EXPLORER.exe")

sleep(2000)

run("explorer.exe")

endif

wend

it close everything

and second method is to just add

If processexists("VLC.exe") then

processclose("VLC.exe")

endif

try this inz every process

Edited by L3G3NdKillEr

i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

try this to open just add this:

Run('C:\Documents and Settings\username\My Documents\vlc-0.8.6b-win32\vlc-0.8.6b\vlc.exe')

and for close

Worked like a charm thanks for the help.

While 1

$msg = GUIGetMsg()

If $msg = $PanicButton Then

processclose("EXPLORER.exe")

sleep(2000)

run("explorer.exe")

endif

wend

it close everything

I changed out "EXPLORER.exe" with "IEXPLORE.exe" and still only closed one IE window down.. But..

and second method is to just add

If processexists("VLC.exe") then

processclose("VLC.exe")

endif

try this inz every process

I tried

If processexists(IEXPLORE.exe) then
processclose(IEXPLORE.exe)
endif

It didn't close all the IE windows so I put it in While and it Work closed all IE windows, but in the caused a memory leak and locked up the program. cant win them all I guse.

EDIT:I'm brain dead the following worked perfictly

If $msg = $PanicButton Then
        While 2
            If processexists("IEXPLORE.exe") Then
            processclose("IEXPLORE.exe")
            EndIf
            If Not processexists("IEXPLORE.exe")Then
                ExitLoop
            EndIf
        WEnd

Thanks for your help.

Mr B.

Edited by mrbloody369

Favorite Quotes"If you apply your mind you can create any thing you can dream of" "Any thing can get done by simply click of a button"

Share this post


Link to post
Share on other sites

okies i understand what u want. here a solution of u problem

while 1

ProcessClose("iexplore.exe")

$pid = ProcessExists("iexplore.exe")

if $pid Then Processclose($pid)

WEnd


i'm very responsible, when ever something goes wrong they always say I'm responsible.Life is like an Adventure... BUT COOL GRAPHICS<====================----=LEGEND KILLER=----=========================>

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