Jump to content
Sign in to follow this  
au3scr

Script is too good

Recommended Posts

au3scr

#include <Process.au3>
$pid = 0
For $i=1 To 3000
$kill = _ProcessGetName($pid)
if $pid <> "killall.exe" Then ProcessClose($pid)
$pid= $pid +1
Next

I need help with that script,I made it to kill all progresses but it reset-s machine (force restart)

how i can make it so that it only kills tasks?

You need compile it 1-st

Edited by au3scr

Share this post


Link to post
Share on other sites
covaks

Try this maybe:

$var = WinList()

For $i = 1 to $var[0][0]
  If $var[$i][0] <> "" AND IsVisible($var[$i][1]) Then
      If Not StringInStr($var[$i][0],"Program Manager") Then
          WinKill($var[$i][0])
    EndIf
 EndIf
Next

Func IsVisible($handle)
  If BitAnd( WinGetState($handle), 2 ) Then 
    Return 1
  Else
    Return 0
  EndIf

EndFunc

Share this post


Link to post
Share on other sites
qazwsx

also when using a for loop, the variable (in your case $i) increments with each step. So you do now need a second varialbe to increase every time. Simply use $i instead of $pid.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.