杀进程

windows结束进程的命令:

1. TSKILL

TSKILL processid | processname [/SERVER:servername] [/ID:sessionid | /A] [/V]

  processid                           要结束的进程的 Process ID。
  processname                     要结束的进程名称。
  /SERVER:servername          含有 processID 的服务器(默认值是当前值)。
                                             使用进程名和 /SERVER 时,必须指定
                                             /ID 或 /A
  /ID:sessionid                       结束在指定会话下运行的进程。
  /A                                      结束在所有会话下运行的进程。
  /V                                      显示正在执行的操作的信息。

2. TASKKILL

TASKKILL [/S system [/U username [/P [password]]]]
         { [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]

描述:
    这个命令行工具可用来结束至少一个进程。
    可以根据进程 id 或图像名来结束进程。

参数列表:
    /S    system           指定要连接到的远程系统。

    /U    [domain/]user    指定应该在哪个用户上下文
                           执行这个命令。

    /P    [password]       为提供的用户上下文指定
                           密码。如果忽略,提示输入。

    /F                     指定要强行终止
                           进程。

    /FI   filter           指定筛选进或筛选出查询的
                           的任务。

    /PID  process id       指定要终止的进程的
                           PID。

    /IM   image name       指定要终止的进程的
                           图像名。通配符 '*'
                           可用来指定所有图像名。

    /T                     Tree kill: 终止指定的进程
                           和任何由此启动的子进程。

    /?                     显示帮助/用法。

筛选器:
    筛选器名      有效运算符                有效值
    -----------   ---------------           --------------
    STATUS        eq, ne                    运行 | 没有响应
    IMAGENAME     eq, ne                    图像名
    PID           eq, ne, gt, lt, ge, le    PID 值
    SESSION       eq, ne, gt, lt, ge, le    会话编号
    CPUTIME       eq, ne, gt, lt, ge, le    CPU 时间,格式为
                                            hh:mm:ss。
                                            hh - 时,
                                            mm - 钟,ss - 秒
    MEMUSAGE      eq, ne, gt, lt, ge, le    内存使用,单位为 KB
    USERNAME      eq, ne                    用户名,格式为
                                            [domain/]user
    MODULES       eq, ne                    DLL 名
    SERVICES        eq, ne                    服务名
    WINDOWTITLE     eq, ne                    窗口标题

注意: 只有带有筛选器的情况下,才能跟 /IM 切换使用通配符 '*'。

注意: 远程进程总是要强行终止,
      不管是否指定了 /F 选项。

例如:
    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*"

3. ntsd

usage: ntsd [-?] [-2] [-d] [-g] [-G] [-myob] [-lines] [-n] [-o] [-s] [-v] [-
            [-r BreakErrorLevel]  [-t PrintErrorLevel]
            [-hd] [-pd] [-pe] [-pt #] [-pv] [-x | -x{e|d|n|i} <event>]
            [-- | -p pid | -pn name | command-line | -z CrashDmpFile]
            [-zp CrashPageFile] [-premote transport] [-robp]
            [-aDllName] [-c "command"] [-i ImagePath] [-y SymbolsPath]
            [-clines #] [-srcpath SourcePath] [-QR //machine] [-wake <pid>]
            [-remote transport:server=name,portid] [-server transport:portid
            [-ses] [-sfce] [-sicv] [-snul] [-noio] [-failinc] [-noshell]

where: -? displays this help text
       command-line is the command to run under the debugger
       -- is the same as -G -g -o -p -1 -d -pd
       -aDllName sets the default extension DLL
       -c executes the following debugger command
       -clines number of lines of output history retrieved by a remote clien
       -failinc causes incomplete symbol and module loads to fail
       -d sends all debugger output to kernel debugger via DbgPrint
          -d cannot be used with debugger remoting
          -d can only be used when the kernel debugger is enabled
       -g ignores initial breakpoint in debuggee
       -G ignores final breakpoint at process termination
       -hd specifies that the debug heap should not be used
           for created processes.  This only works on Windows Whistler.
       -o debugs all processes launched by debuggee
       -p pid specifies the decimal process Id to attach to
       -pd specifies that the debugger should automatically detach
       -pe specifies that any attach should be to an existing debug port
       -pn name specifies the name of the process to attach to
       -pt # specifies the interrupt timeout
       -pv specifies that any attach should be noninvasive
       -r specifies the (0-3) error level to break on (SeeSetErrorLevel)
       -robp allows breakpoints to be set in read-only memory
       -t specifies the (0-3) error level to display (SeeSetErrorLevel)
       -w specifies to debug 16 bit applications in a separate VDM
       -x sets second-chance break on AV exceptions
       -x{e|d|n|i} <event> sets the break status for the specified event
       -2 creates a separate console window for debuggee
       -i ImagePath specifies the location of the executables that generated
          the fault (see _NT_EXECUTABLE_IMAGE_PATH)
       -lines requests that line number information be used if present
       -myob ignores version mismatches in DBGHELP.DLL
       -n enables verbose output from symbol handler
       -noio disables all I/O for dedicated remoting servers
       -noshell disables the .shell (!!) command
       -QR <//machine> queries for remote servers
       -s disables lazy symbol loading
       -ses enables strict symbol loading
       -sfce fails critical errors encountered during file searching
       -sicv ignores the CV record when symbol loading
       -snul disables automatic symbol loading for unqualified names
       -srcpath <SourcePath> specifies the source search path
       -v enables verbose output from debugger
       -wake <pid> wakes up a sleeping debugger and exits
       -y <SymbolsPath> specifies the symbol search path (see _NT_SYMBOL_PAT
       -z <CrashDmpFile> specifies the name of a crash dump file to debug
       -zp <CrashPageFile> specifies the name of a page.dmp file
                           to use with a crash dump
       -remote lets you connect to a debugger session started with -server
               must be the first argument if present
               transport: tcp | npipe | ssl | spipe | 1394 | com
               name: machine name on which the debug server was created
               portid: id of the port the debugger server was created on
                   for tcp use:  port=<socket port #>
                   for npipe use:  pipe=<name of pipe>
                   for 1394 use:  channel=<channel #>
                   for com use:  port=<COM port>,baud=<baud rate>,
                                 channel=<channel #>
                   for ssl and spipe see the documentation
               example: ... -remote npipe:server=yourmachine,pipe=foobar
       -server creates a debugger session other people can connect to
               must be the first argument if present
               transport: tcp | npipe | ssl | spipe | 1394 | com
               portid: id of the port remote users can connect to
                   for tcp use:  port=<socket port #>
                   for npipe use:  pipe=<name of pipe>
                   for 1394 use:  channel=<channel #>
                   for com use:  port=<COM port>,baud=<baud rate>,
                                 channel=<channel #>
                   for ssl and spipe see the documentation
               example: ... -server npipe:pipe=foobar
       -premote transport specifies the process server to connect to
              transport arguments are given as with remoting

Environment Variables:

    _NT_SYMBOL_PATH=[Drive:][Path]
        Specify symbol image path.

    _NT_ALT_SYMBOL_PATH=[Drive:][Path]
        Specify an alternate symbol image path.

    _NT_DEBUGGER_EXTENSION_PATH=[Drive:][Path]
        Specify a path which should be searched first for extensions dlls

    _NT_EXECUTABLE_IMAGE_PATH=[Drive:][Path]
        Specify executable image path.

    _NT_SOURCE_PATH=[Drive:][Path]
        Specify source file path.

    _NT_DEBUG_LOG_FILE_OPEN=filename
        If specified, all output will be written to this file from offset 0.

    _NT_DEBUG_LOG_FILE_APPEND=filename
        If specified, all output will be APPENDed to this file.

    _NT_DEBUG_HISTORY_SIZE=size
        Specifies the size of a server's output history in kilobytes

Control Keys:

     <Ctrl-B><Enter> Quit debugger
     <Ctrl-C>        Break into Target
     <Ctrl-F><Enter> Force a break into debuggee (same as Ctrl-C)
     <Ctrl-P><Enter> Debug Current debugger
     <Ctrl-V><Enter> Toggle Verbose mode
     <Ctrl-W><Enter> Print version information

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值