返回列表 回復 發帖

微軟一個罕為人知的無敵命令

作者: wen 日期: 2007-12-30 20:13 閱讀: 2577 人 打印 收藏 大 中 小
微軟一個罕為人知的無敵命令


  問:怎麼才能關掉一個用任務管理器關不了的進程?我前段時間發現我的機子�埵h了一個進程,只要開機就在,我用任務管理器卻怎麼關也關不了

  答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 中所附的幫助檔。用法:開個cmd.exe視窗,輸入:

  ntsd -c q -p PID

  把最後那個PID,改成你要終止的進程的ID。如果你不知道進程的ID,任務管理器->進程選項卡->查看->選擇列->勾上"PID(進程識別字)",然後就能看見了。

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

參考資料:
NTSD 的幫助檔
  1. usage: ntsd [-?] [-2] [-d] [-g] [-G] [-myob] [-lines] [-n] [-o] [-s] [-v] [-w]
  2.             [-r BreakErrorLevel]  [-t PrintErrorLevel]
  3.             [-hd] [-pd] [-pe] [-pt #] [-pv] [-x | -x{e|d|n|i} ]
  4.             [-- | -p pid | -pn name | command-line | -z CrashDmpFile]
  5.             [-zp CrashPageFile] [-premote transport] [-robp]
  6.             [-aDllName] [-c "command"] [-i ImagePath] [-y SymbolsPath]
  7.             [-clines #] [-srcpath SourcePath] [-QR \\machine] [-wake ]
  8.             [-remote transport:server=name,portid] [-server transport:portid]
  9.             [-ses] [-sfce] [-sicv] [-snul] [-noio] [-failinc] [-noshell]

  10. where: -? displays this help text
  11.        command-line is the command to run under the debugger
  12.        -- is the same as -G -g -o -p -1 -d -pd
  13.        -aDllName sets the default extension DLL
  14.        -c executes the following debugger command
  15.        -clines number of lines of output history retrieved by a remote client
  16.        -failinc causes incomplete symbol and module loads to fail
  17.        -d sends all debugger output to kernel debugger via DbgPrint
  18.           -d cannot be used with debugger remoting
  19.           -d can only be used when the kernel debugger is enabled
  20.        -g ignores initial breakpoint in debuggee
  21.        -G ignores final breakpoint at process termination
  22.        -hd specifies that the debug heap should not be used
  23.            for created processes.  This only works on Windows Whistler.
  24.        -o debugs all processes launched by debuggee
  25.        -p pid specifies the decimal process Id to attach to
  26.        -pd specifies that the debugger should automatically detach
  27.        -pe specifies that any attach should be to an existing debug port
  28.        -pn name specifies the name of the process to attach to
  29.        -pt # specifies the interrupt timeout
  30.        -pv specifies that any attach should be noninvasive
  31.        -r specifies the (0-3) error level to break on (SeeSetErrorLevel)
  32.        -robp allows breakpoints to be set in read-only memory
  33.        -t specifies the (0-3) error level to display (SeeSetErrorLevel)
  34.        -w specifies to debug 16 bit applications in a separate VDM
  35.        -x sets second-chance break on AV exceptions
  36.        -x{e|d|n|i} sets the break status for the specified event
  37.        -2 creates a separate console window for debuggee
  38.        -i ImagePath specifies the location of the executables that generated
  39.           the fault (see _NT_EXECUTABLE_IMAGE_PATH)
  40.        -lines requests that line number information be used if present
  41.        -myob ignores version mismatches in DBGHELP.DLL
  42.        -n enables verbose output from symbol handler
  43.        -noio disables all I/O for dedicated remoting servers
  44.        -noshell disables the .shell (!!) command
  45.        -QR <\\machine> queries for remote servers
  46.        -s disables lazy symbol loading
  47.        -ses enables strict symbol loading
  48.        -sfce fails critical errors encountered during file searching
  49.        -sicv ignores the CV record when symbol loading
  50.        -snul disables automatic symbol loading for unqualified names
  51.        -srcpath specifies the source search path
  52.        -v enables verbose output from debugger
  53.        -wake wakes up a sleeping debugger and exits
  54.        -y specifies the symbol search path (see _NT_SYMBOL_PATH)
  55.        -z specifies the name of a crash dump file to debug
  56.        -zp specifies the name of a page.dmp file
  57.                            to use with a crash dump
  58.        -remote lets you connect to a debugger session started with -server
  59.                must be the first argument if present
  60.                transport: tcp | npipe | ssl | spipe | 1394 | com
  61.                name: machine name on which the debug server was created
  62.                portid: id of the port the debugger server was created on
  63.                    for tcp use:  port=
  64.                    for npipe use:  pipe=
  65.                    for 1394 use:  channel=
  66.                    for com use:  port=,baud=,
  67.                                  channel=
  68.                    for ssl and spipe see the documentation
  69.                example: ... -remote npipe:server=yourmachine,pipe=foobar
  70.        -server creates a debugger session other people can connect to
  71.                must be the first argument if present
  72.                transport: tcp | npipe | ssl | spipe | 1394 | com
  73.                portid: id of the port remote users can connect to
  74.                    for tcp use:  port=
  75.                    for npipe use:  pipe=
  76.                    for 1394 use:  channel=
  77.                    for com use:  port=,baud=,
  78.                                  channel=
  79.                    for ssl and spipe see the documentation
  80.                example: ... -server npipe:pipe=foobar
  81.        -premote transport specifies the process server to connect to
  82.               transport arguments are given as with remoting

  83. Environment Variables:

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

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

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

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

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

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

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

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

  100. Control Keys:

  101.      Quit debugger
  102.              Break into Target
  103.      Force a break into debuggee (same as Ctrl-C)
  104.      Debug Current debugger
  105.      Toggle Verbose mode
  106.      Print version information
  107. ntsd: exiting - press enter ---
複製代碼
2005.12.04不預期遇見什麼、才可能什麼都能遇見。
如果你是會員,有任何使用上的問題,請發短訊給我(wen)
如果你是訪客的話,註冊之後可以得到完整的瀏覽權限
返回列表