xircon Posted May 16, 2008 Share Posted May 16, 2008 (edited) I occasionally need to clear out all the crud in memory, so I have written a little script to do it and thought someone may find it useful. It uses process explorer from Sysinternals to produce a list of active processes. Processes that have been commented "REMOVE" are closed. To comment a process in Process explorer, just right click it and enter some text in the box. #include <array.au3> Opt("WinTitleMatchMode", 2) ;Run Process Explorer and save text file. run("C:\ProcessExplorer\procexp.exe") WinWait("Process Explorer") sleep(2000) WinActivate("Process Explorer") Send("!fs{ENTER}") $lcount=1 $file=fileopen(@DesktopDir&"\"&"procexp.txt",0) ;Read into array while 1 $line=filereadline($file,$lcount+1) If $file = -1 Then Exit EndIf $info = StringSplit($line,chr(9)) ;Kill Process off if $info[6]="REMOVE" then if ProcessExists($info[1]) then ProcessClose($info[1]) endif ;Increment Counter $lcount=$lcount+1 WEnd Edited May 16, 2008 by xircon 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