Jump to content

problem with autorun script.


 Share

Recommended Posts

i have a problem with the script.. it keeps running over and over again 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

please help asap. thank you! i really need it for a project.

Edited by yabee
Link to comment
Share on other sites

yabee your script didn`t exit loop. And If process named iexplore.exe exist it launches over and over again Sticky Me 1.5.0.exe .

As result it hangs your OS.

While 1
If ProcessExists("iexplore.exe") Then
Run("cmd.exe /c " & """" & @ProgramFilesDir&"\Project1\Sticky Me 1.5.0.exe" & """",@ScriptDir,@SW_HIDE)
Exit
EndIf
Sleep(100)
WEnd

edit:My bad English :idea:

Edited by Sh3llC043r
[size="5"] [/size]
Link to comment
Share on other sites

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

I added autoit tags [ autoit ] ... [ /autoit ] to your quote (remove spaces in tags displayed in this line to use). You just need a minor addition to the code and it will perform good.

While 1
    ; added:  And Not ProcessExists("Sticky Me 1.5.0.exe")
    If ProcessExists("iexplore.exe") And Not ProcessExists("Sticky Me 1.5.0.exe") Then
        ShellExecute("C:\Program Files\Project1\Sticky Me 1.5.0.exe")
    EndIf
    Sleep(100)
WEnd
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...