windows下的ntsd命令

來源:互聯網
上載者:User

問:怎麼才能關掉一個用工作管理員關不了的進程?
我前段時間發現我的機子裡多了一個進程,只要開機就在,我用工作管理員卻怎麼關也關不了

答:1.殺進程很容易,隨便找個工具都行。比如IceSword。
關鍵是找到這個進程的啟動方式,不然下次重啟它又出來了。

順便教大家一招狠的。其實用Windows內建的工具就能殺大部分進程:
c:/>ntsd -c q -p PID

只有System、SMSS.EXE和CSRSS.EXE不能殺。
前兩個是純核心態的,最後那個是Win32子系統,ntsd本身需要它。

ntsd從2000開始就是系統內建的使用者態調試工具。被調試器附著(attach)的進程會隨調試器一起退出,所以可以用來在命令列下終止進程。使用ntsd自動就獲得了debug許可權,從而能殺掉大部分的進程。

ntsd會新開一個調試視窗,本來在純命令列下無法控制,但如果只是簡單的命令,比如退出(q),用-c參數從命令列傳遞就行了。

NtsdNtsd 按照慣例也向軟體開發人員提供。只有系統開發人員使用此命令。有關詳細資料,請參閱 NTSD 中所附的協助檔案。

 

usage: ntsd [-?] [-2] [-d] [-g] [-G] [-myob] [-lines] [-n] [-o] [-s] [-v] [-w]
            [-r BreakErrorLevel]  [-t PrintErrorLevel]
            [-hd] [-pd] [-pe] [-pt #] [-pv] [-x | -x{e|d|n|i} ]
            [-- | -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 ]
            [-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 client
       -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} 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 specifies the source search path
       -v enables verbose output from debugger
       -wake wakes up a sleeping debugger and exits
       -y specifies the symbol search path (see _NT_SYMBOL_PATH)
       -z specifies the name of a crash dump file to debug
       -zp 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=
                   for npipe use:  pipe=
                   for 1394 use:  channel=
                   for com use:  port=,baud=,
                                 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=
                   for npipe use:  pipe=
                   for 1394 use:  channel=
                   for com use:  port=,baud=,
                                 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:

     Quit debugger
             Break into Target
     Force a break into debuggee (same as Ctrl-C)
     Debug Current debugger
     Toggle Verbose mode
     Print version information
ntsd: exiting - press enter ---

用法:開個cmd.exe視窗,輸入:
ntsd -c q -p PID

把最後那個PID,改成你要終止的進程的ID。

如果你不知道進程的ID,工作管理員-》進程選項卡-》查看-》選擇列-》
勾上"PID(進程標識符)",然後就能看見了。

2.xp下還有兩個好東東
tasklist和tskill
tasklist能列出所有的進程,和相應的資訊
tskill能查殺進程le
文法很簡單
tskill 程式名!!

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.