DOS forced kill process command _dos/bat

Source: Internet
Author: User
Tags goto sleep

Tskill and NTSD commands, two can end the task Manager process, or, alternatively, you can close the application. However, the use and scope of the two are different, the following, this article to give you a brief introduction.

Introduction to the ①NTSD command

Copy Code code as follows:

C:\>ntsd-c q-p PID

Only system, SMSS. EXE and CSRSS.EXE can't kill.

The first two are pure kernel state, the last one is the WIN32 subsystem, NTSD itself needs it. NTSD starting from 2000 is the system's own user-state debugging tool. A process that is attached to the debugger (attach) exits with the debugger, so it can be used to terminate the process at the command line. Using NTSD automatically gets debug permissions, which kills most of the process. NTSD will open a new debugging window, which could not be controlled at the pure command line, but if it is simply a command, such as exit (Q), it can be passed from the command line with the-c parameter. NTSDNTSD is also provided to software developers in accordance with established practice. This command is only used by system developers.

Usage: Open a cmd.exe window and enter:

Ntsd-c q-p PID

Change the last PID to the ID of the process you want to terminate. If you do not know the ID of the process, Task Manager-> process tab-> view-> Select column-> tick "TID (process Identifier)" and then you can see it.

 Introduction to the ②tskill command

Tskill can killing process, syntax is very simple: Tskill program name!!

For example, to close the browser process, you can enter the command at the DOS input prompt: Tskill iexplore.exe press ENTER.

DOS View and select Force Abort process

Copy Code code as follows:

@echo off
Echo Set Sh=wscript.createobject ("Wscript.Shell") >telnet_tmp.vbs
Echo Wscript.Sleep->>telnet_tmp.vbs
REM change the 192.168.1.7 to the IP address you want to log in to
Echo Sh. SendKeys "Open 192.168.1.7" >>telnet_tmp.vbs
echo Wscript.Sleep 5000 >>telnet_tmp.vbs
Echo Sh. SendKeys ' {ENTER} ' >>telnet_tmp.vbs
echo Wscript.Sleep 20000 >>telnet_tmp.vbs
Echo Sh. SendKeys "Y{enter}" >>telnet_tmp.vbs
echo Wscript.Sleep 1000 >>telnet_tmp.vbs
REM User Name
Echo Sh. SendKeys "Ocular_admin{enter}" >>telnet_tmp.vbs
echo Wscript.Sleep 5000 >>telnet_tmp.vbs
REM Password
Echo Sh. SendKeys "Lcdchina{enter}" >>telnet_tmp.vbs
echo Wscript.Sleep 5000 >>telnet_tmp.vbs
rem Start Telnet
cscript//nologo Telnet_tmp.vbs
Del Telnet_tmp.vbs
REM View process information below
Tasklist
REM lets the user select the process PID to remove
set/p ans= Please enter the process PID to remove:
echo the PID of the process you want to delete is%ans%
REM to determine the user's choice of the following
Set choice=
set/p choice= Are you sure you want to remove the PID as%ans% process? (y/n)
if/i "%choice%" = = "Y" goto Yes
if/i "%choice%" = = "n" Goto No
: Yes
REM Execution Force Delete process command
Ntsd-c q-p%ans%
: No
REM can also use "Taskkill/im process name" to force removal of processes under XP
Tasklist
REM Pause
Pause

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.