Jump to content

another instance is already running


Recommended Posts

i'm having a small issue with firefox portable here.

behold, my script of death!

HotKeySet("^{F9}", "killtheprocess")
dim $ison=0 
dim $loop=1
Run("firefox.exe", "D:\FirefoxPortable") Sleep(100) 
if ProcessExists("firefox.exe") Then    
$ison=1 
EndIf  
While $loop=1   
Sleep(100)
WEnd
Func killtheprocess()
if $ison=1 Then
ProcessClose("firefox.exe")
Exit
Else
Exit
EndIf EndFunc

i make sure to check for any firefox.exe's running in my task manager before running this.

it says that another firefox is already running, or running but not responding (it chooses them randomly, i think)

and suggest i take a look to make sure it's dead.

it's dead. very dead. why does it claim to have other instances, despite the fact i have none.

i already did something like this once, except i forgot how :)

Link to comment
Share on other sites

i'm having a small issue with firefox portable here.

behold, my script of death!

HotKeySet("^{F9}", "killtheprocess")
dim $ison=0 
dim $loop=1
Run("firefox.exe", "D:\FirefoxPortable") Sleep(100) 
if ProcessExists("firefox.exe") Then    
$ison=1 
EndIf  
While $loop=1   
Sleep(100)
WEnd
Func killtheprocess()
if $ison=1 Then
ProcessClose("firefox.exe")
Exit
Else
Exit
EndIf EndFunc

i make sure to check for any firefox.exe's running in my task manager before running this.

it says that another firefox is already running, or running but not responding (it chooses them randomly, i think)

and suggest i take a look to make sure it's dead.

it's dead. very dead. why does it claim to have other instances, despite the fact i have none.

i already did something like this once, except i forgot how :)

try this

HotKeySet("^{F9}", "killtheprocess")

dim $loop=1

Run("firefox.exe", "D:\FirefoxPortable") Sleep(100)

if ProcessExists("firefox.exe") Then

killtheprocess()

EndIf

While $loop=1

Sleep(100)

WEnd

Func killtheprocess()

ProcessClose("firefox.exe")

Exit

EndFunc

Edited by shawnmstout
Link to comment
Share on other sites

my firefox tends to freeze and i don't like going into the task manager because it takes a few good minutes for it to load some times.

thus, the script checks to see if firefox.exe exists first, to see if its actually needed.

then, upon confirmation of firefox exe it kills it.

if not, just exit.

why the hell doesn't it work?!

Link to comment
Share on other sites

Couldn't reproduce instance issue. One problem I see is too short pause after Run.

Here is what I ended up with while tweaking it:

HotKeySet("^{F9}", "killtheprocess")

If Not ProcessExists("firefox.exe") Then
    Run("G:\_Firefox\FirefoxPortable.exe", "G:\_Firefox\") 
Else
    MsgBox(0,"","Firefox already running")
    Exit
EndIf

Do
    Sleep(100)
Until ProcessExists("firefox.exe")

While 1
    Sleep(100)
WEnd

Func killtheprocess()
    ProcessClose("firefox.exe")
    Exit
EndFunc

By the way what's wrong with Alt+F4 to close FIrefox? >_<

Link to comment
Share on other sites

Try it:

HotKeySet("^{F9}", "killtheprocess")

If Not ProcessExists("firefox.exe") Then
    Run("firefox.exe", "D:\FirefoxPortable") 
Else
    MsgBox(0,'',"Firefox already running")   
EndIf

While ProcessExists('firefox.exe')
    Sleep(100)
WEnd

Func killtheprocess()
    While ProcessExists('firefox.exe')
        ProcessClose("firefox.exe")
    WEnd
    Exit
EndFunc

AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line
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...