Jump to content

Need help with making an autorun script


 Share

Recommended Posts

I need to make a script that when I open internet explorer or mozilla firefox, my program would autorun.

could you please help me making that code..

I came up with this code but it hasnt worked out yet

if $iexplore.exe = [open]

[autorun] = c:\program files\project1\sticky me 1.5.0

please help me ASAP.. Im really in a rush.

Link to comment
Share on other sites

nvm, i got it.. but i still have a problem with the script.. i keeps running until my laptop hangs.. whats wrong with the code?

While 1

If ProcessExists("iexplore.exe") Then

ShellExecute("C:\Program Files\Project1\Sticky Me 1.5.0.exe")

EndIf

Sleep(100)

WEnd

Link to comment
Share on other sites

i am unsure if this would work, but you can try experimenting a little with this -

While 1
If ProcessExists("iexplore.exe") Then
ShellExecute("C:\Program Files\Project1\Sticky Me 1.5.0.exe")
EndIf
Sleep(100)
If ProcessExists("Sticky Me 1.5.0.exe") then
exit
EndIf
WEnd

I have not tested it, however it may work.

The problem with your original script appears to be that when iexplore is launched, it runs Sticky Me 1.5.0.exe then sleeps, and starts over again and because iexplore exists it will launch Sticky Me 1.5.0.exe again.

Correct me if im wrong, however the solution i posted should work okay

EDIT1: Forgot to put in endif, now fixed... however i am unsure if the endif is in the correct place... try experimenting a little :idea:

EDIT2: Fixed the code, do not need the else which was previously there I have not tried to see if it works or not however i no longer get any syntax errors.

Edited by omnomnom
Link to comment
Share on other sites

i am unsure if this would work, but you can try experimenting a little with this -

While 1
If ProcessExists("iexplore.exe") Then
ShellExecute("C:\Program Files\Project1\Sticky Me 1.5.0.exe")
EndIf
Sleep(100)
If ProcessExists("Sticky Me 1.5.0.exe") then
exit
EndIf
WEnd

I have not tested it, however it may work.

The problem with your original script appears to be that when iexplore is launched, it runs Sticky Me 1.5.0.exe then sleeps, and starts over again and because iexplore exists it will launch Sticky Me 1.5.0.exe again.

Correct me if im wrong, however the solution i posted should work okay

EDIT1: Forgot to put in endif, now fixed... however i am unsure if the endif is in the correct place... try experimenting a little :idea:

EDIT2: Fixed the code, do not need the else which was previously there I have not tried to see if it works or not however i no longer get any syntax errors.

it works nicely. thank you for the help and explanation!

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