Joosh Posted August 20, 2004 Share Posted August 20, 2004 Ok I was just wondering if there is anyway to make a script that is always open and when a specific program activates it automatically closes it? I am helping one of the administrators of my school to find loopholes in the security system so that they can then patch them up. any ideas? any info would be greatly appreciated Link to comment Share on other sites More sharing options...
Lazycat Posted August 20, 2004 Share Posted August 20, 2004 If I understand right, you need a script which waiting for some program run and close it immediately? You need simple infinite loop and you can put into it anything: While 1 ; You need this line to reduce CPU load Sleep(100) ; You can find window by title (or by window class) If WinExists("your program window title") Then WinClose("your program window title") ; Or you can find and close process If ProcessExists("processname.exe") Then ProcessClose("processname.exe") Wend Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
Joosh Posted August 20, 2004 Author Share Posted August 20, 2004 thanks so much... could you do me another big favour and explain to me how that makes an infinite loop? Link to comment Share on other sites More sharing options...
Lazycat Posted August 20, 2004 Share Posted August 20, 2004 The infinite loop most simple to do with While..Wend keywords. When you write "While 1" this is equal "While 1=1", so this expression will be always true and loop will run infinitely. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now