|
Cum putem opri un proces fara Windows Task Manager
Exista situatii cand vrem sa terminam un proces din windows-ului, care blocheaza sistemul si oricat am incerca din Windows Task Manager nu reusim, singura solutie fiind restartarea sistemului. Inainte insa de restart mai putem incerca ceva, si anume taskkill. Taskkill e o comanda in DOS (CLI pe Windows, huh!?) care uneori poate fi mai eficienta decat WTM, putand sa opreasca procese care altfel nu pot fi oprite nici macar de acesta din urma.
Pentru a o putea folosi insa, trebuie sa facem unele pregatiri. In primul rand, avem nevoie de PID-ul (sau Process ID-ul) aplicatiei. In afisarea implicita, WTM-ul furnizeaza foarte putine informatii despre procesele ce ruleaza la un moment dat. Dar acest lucru poate fi indreptat.
Deschideti Windows Task Manager si mergeti la butonul View din meniu. Aici alegeti Select Columns.

In fereastra ce se deschide bifati PID

dupa care apasati OK. Acum, in WTM veti vedea o noua coloana, si anume PID.
La ce foloseste aceasta?
Ei bine, in cazul in care ati incercat sa opriti un proces din WTM si nu ati reusit, avand PID-ul sau puteti foarte usor sa-l opriti din Command Prompt, folosind tocmai comanda de care vorbeam la inceput, anume Taskkill.
Iata mai jos sintaxa comenzii:
C:\Documents and Settings\test>taskkill /?
TASKKILL [/S system [/U username [/P [password]]]] { [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]
Description: This command line tool can be used to end one or more processes. Processes can be killed by the process id or image name.
Parameter List: /S system Specifies the remote system to connect to.
/U [domain\]user Specifies the user context under which the command should execute.
/P [password] Specifies the password for the given user context. Prompts for input if omitted.
/F Specifies to forcefully terminate process(es).
/FI filter Displays a set of tasks that match a given criteria specified by the filter.
/PID process id Specifies the PID of the process that has to be terminated.
/IM image name Specifies the image name of the process that has to be terminated. Wildcard '*' can be used to specify all image names.
/T Tree kill: terminates the specified process and any child processes which were started by it.
/? Displays this help/usage.
Filters: Filter Name Valid Operators Valid Value(s) ----------- --------------- -------------- STATUS eq, ne RUNNING | NOT RESPONDING IMAGENAME eq, ne Image name PID eq, ne, gt, lt, ge, le PID value SESSION eq, ne, gt, lt, ge, le Session number. CPUTIME eq, ne, gt, lt, ge, le CPU time in the format of hh:mm:ss. hh - hours, mm - minutes, ss - seconds MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB USERNAME eq, ne User name in [domain\]user format MODULES eq, ne DLL name SERVICES eq, ne Service name WINDOWTITLE eq, ne Window title
NOTE: Wildcard '*' for the /IM switch is accepted only with filters.
NOTE: Termination of remote processes will always be done forcefully irrespective of whether /F option is specified or not.
Examples: TASKKILL /S system /F /IM notepad.exe /T TASKKILL /PID 1230 /PID 1241 /PID 1253 /T TASKKILL /F /IM notepad.exe /IM mspaint.exe TASKKILL /F /FI "PID ge 1000" /FI "WINDOWTITLE ne untitle*" TASKKILL /F /FI "USERNAME eq NT AUTHORITY\SYSTEM" /IM notepad.exe TASKKILL /S system /U domain\username /FI "USERNAME ne NT*" /IM * TASKKILL /S system /U username /P password /FI "IMAGENAME eq note*"
Asadar, daca doriti sa opriti procesul cu PID-ul 3444 comanda va fi
taskkill /PID 3444
sau
taskkill /PID 3444 /F (pentru a forta oprirea acestui proces)
sau
taskkill /PID 3444 /F /T (pentru a forta oprirea procesului si a tuturor celorlalte procese pornite de acest proces)
Iata asadar, ca nu intotdeauna este nevoie de restart pentru a putea opri un proces agatat si care se incapataneaza sa nu se lase oprit.
|