Jump to content

If else loop?


Recommended Posts

I am trying to write a simple little program that waits for yahoo messenger to load, then kills it and remains running.. So if the user tries to load yahoo again, it will kill it again and so on..

This is what I have so far, the problem with it is, well its not done right, and I know there is a better way of performing this..

CODE
If ProcessExists ("YahooMessenger.exe") Then

Processclose ("YahooMessenger.exe")

EndIf

Sleep(2000);

Run("c:\killyahoo.exe");

anybody have any ideas?

also, Is there a way for it to watch for a few different services also?

Link to comment
Share on other sites

wait, I just realized this would work..

Anybody have any comments on if this is a good way to approach this or not?

also how do I hide the icon, I used

#No TrayIcon but it still shows up..

CODE
While 1

If ProcessExists ("YahooMessenger.exe") Then

Processclose ("YahooMessenger.exe")

EndIf

Sleep(15000)

WEnd

Link to comment
Share on other sites

Link to comment
Share on other sites

one more suggestion would be to compile it to .exe and have it run as scheduled task on startup (as restarting the computer will close the script). one more precaution would be to give it a more ambiguous name so that it won't be detected with a ctrl+alt+delete.

cheers :P

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