Jump to content
Sign in to follow this  
yabee

problem with autorun script.

Recommended Posts

yabee

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

Share this post


Link to post
Share on other sites
somdcomputerguy

You've got the body of the script running within a While...WEnd loop. 1 will always equal 1, so...


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
Fire

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]

Share this post


Link to post
Share on other sites
yabee

thank you so much guys. the script works well ^^

Share this post


Link to post
Share on other sites
omnomnom

you have another thread at http://www.autoitscript.com/forum/index.php?showtopic=113421&st=0 which i have replied to which should answer your problem =)

Share this post


Link to post
Share on other sites
MHz

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

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  

×