Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
8.7 KiB

  1. #include <windows.h>
  2. #include "resource.h"
  3. #include "cmdlineres.h"
  4. #include "cmdline.rc"
  5. /////////////////////////////////////////////////////////////////////////////
  6. //
  7. // String Table
  8. //
  9. STRINGTABLE DISCARDABLE
  10. BEGIN
  11. IDS_HELP_LINE1 "\nTASKKILL [/S system [/U username [/P [password]]]]\n"
  12. IDS_HELP_LINE2 " { [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]\n"
  13. IDS_HELP_LINE3 "\n"
  14. IDS_HELP_LINE4 "Description:\n"
  15. IDS_HELP_LINE5 " This command line tool can be used to end one or more processes.\n"
  16. IDS_HELP_LINE6 " Processes can be killed by the process id or image name.\n"
  17. IDS_HELP_LINE7 "\n"
  18. IDS_HELP_LINE8 "Parameter List:\n"
  19. IDS_HELP_LINE9 " /S system Specifies the remote system to connect to.\n\n"
  20. IDS_HELP_LINE10 " /U [domain\\]user Specifies the user context under which\n"
  21. IDS_HELP_LINE11 " the command should execute.\n\n"
  22. IDS_HELP_LINE12 " /P [password] Specifies the password for the given\n"
  23. IDS_HELP_LINE13 " user context. Prompts for input if omitted.\n\n"
  24. IDS_HELP_LINE14 " /F Specifies to forcefully terminate\n"
  25. IDS_HELP_LINE15 " process(es).\n\n"
  26. IDS_HELP_LINE16 " /FI filter Displays a set of tasks that match a\n"
  27. IDS_HELP_LINE17 " given criteria specified by the filter.\n\n"
  28. IDS_HELP_LINE18 " /PID process id Specifies the PID of the process that\n"
  29. IDS_HELP_LINE19 " has to be terminated.\n\n"
  30. IDS_HELP_LINE20 " /IM image name Specifies the image name of the process\n"
  31. IDS_HELP_LINE21 " that has to be terminated. Wildcard '*'\n"
  32. IDS_HELP_LINE22 " can be used to specify all image names.\n\n"
  33. IDS_HELP_LINE23 " /T Tree kill: terminates the specified process\n"
  34. IDS_HELP_LINE24 " and any child processes which were started by it.\n\n"
  35. IDS_HELP_LINE25 " /? Displays this help/usage.\n"
  36. IDS_HELP_LINE26 "\n"
  37. IDS_HELP_LINE27 "Filters:\n"
  38. IDS_HELP_LINE28 " Filter Name Valid Operators Valid Value(s)\n"
  39. IDS_HELP_LINE29 " ----------- --------------- --------------\n"
  40. IDS_HELP_LINE30 " STATUS eq, ne RUNNING | NOT RESPONDING\n"
  41. IDS_HELP_LINE31 " IMAGENAME eq, ne Image name\n"
  42. IDS_HELP_LINE32 " PID eq, ne, gt, lt, ge, le PID value\n"
  43. IDS_HELP_LINE33 " SESSION eq, ne, gt, lt, ge, le Session number.\n"
  44. IDS_HELP_LINE34 " CPUTIME eq, ne, gt, lt, ge, le CPU time in the format\n"
  45. IDS_HELP_LINE35 " of hh:mm:ss.\n"
  46. IDS_HELP_LINE36 " hh - hours,\n"
  47. IDS_HELP_LINE37 " mm - minutes, ss - seconds\n"
  48. IDS_HELP_LINE38 " MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB\n"
  49. IDS_HELP_LINE39 " USERNAME eq, ne User name in [domain\\]user\n"
  50. IDS_HELP_LINE40 " format\n"
  51. IDS_HELP_LINE41 " MODULES eq, ne DLL name\n"
  52. IDS_HELP_LINE42 " SERVICES eq, ne Service name\n"
  53. IDS_HELP_LINE43 " WINDOWTITLE eq, ne Window title\n"
  54. IDS_HELP_LINE44 "\n"
  55. IDS_HELP_LINE45 "NOTE: Wildcard '*' for the /IM switch is accepted only with filters.\n\n"
  56. IDS_HELP_LINE46 "NOTE: Termination of remote processes will always be done forcefully\n"
  57. IDS_HELP_LINE47 " irrespective of whether /F option is specified or not.\n\n"
  58. IDS_HELP_LINE48 "Examples:\n"
  59. IDS_HELP_LINE49 " TASKKILL /S system /F /IM notepad.exe /T\n"
  60. IDS_HELP_LINE50 " TASKKILL /PID 1230 /PID 1241 /PID 1253 /T\n"
  61. IDS_HELP_LINE51 " TASKKILL /F /IM notepad.exe /IM mspaint.exe\n"
  62. IDS_HELP_LINE52 " TASKKILL /F /FI ""PID ge 1000"" /FI ""WINDOWTITLE ne untitle*""\n"
  63. IDS_HELP_LINE53 " TASKKILL /F /FI ""USERNAME eq NT AUTHORITY\\SYSTEM"" /IM notepad.exe\n"
  64. IDS_HELP_LINE54 " TASKKILL /S system /U domain\\username /FI ""USERNAME ne NT*"" /IM *\n"
  65. IDS_HELP_LINE55 " TASKKILL /S system /U username /P password /FI ""IMAGENAME eq note*""\n"
  66. END
  67. STRINGTABLE DISCARDABLE
  68. BEGIN
  69. IDS_FILTER_STATUS "status"
  70. IDS_FILTER_IMAGENAME "imagename"
  71. IDS_FILTER_PID "pid"
  72. IDS_FILTER_SESSION "session"
  73. IDS_FILTER_CPUTIME "cputime"
  74. IDS_FILTER_MEMUSAGE "memusage"
  75. IDS_FILTER_USERNAME "username"
  76. IDS_FILTER_SERVICES "services"
  77. IDS_FILTER_WINDOWNAME "windowtitle"
  78. IDS_FILTER_MODULES "modules"
  79. IDS_FVALUES_STATUS "running|not responding"
  80. IDS_OPERATORS_STRING " eq | ne "
  81. IDS_OPERATORS_NUMERIC " eq | ne | lt | gt | le | ge "
  82. IDS_VALUE_RUNNING "Running"
  83. IDS_VALUE_NOTRESPONDING "Not Responding"
  84. IDS_PID_0_DOMAIN "NT AUTHORITY"
  85. IDS_PID_0_USERNAME "SYSTEM"
  86. END
  87. STRINGTABLE DISCARDABLE
  88. BEGIN
  89. IDS_MSG_KILL_SUCCESS "SUCCESS: The process with PID %d has been terminated.\n"
  90. IDS_MSG_KILL_SUCCESS_QUEUED "SUCCESS: The process with PID %d has been queued for termination.\n"
  91. IDS_MSG_KILL_SUCCESS_EX "SUCCESS: The process ""%s"" with PID %d has been terminated.\n"
  92. IDS_MSG_KILL_SUCCESS_QUEUED_EX "SUCCESS: The process ""%s"" with PID %d has been queued for termination.\n"
  93. IDS_MSG_TREE_KILL_SUCCESS "SUCCESS: The process with PID %d child of PID %d has been terminated.\n"
  94. IDS_ERROR_KILL_FAILED "ERROR: The process with PID %d could not be terminated.\nReason: %s"
  95. IDS_ERROR_KILL_FAILED_EX "ERROR: The process ""%s"" with PID %d could not be terminated.\nReason: %s"
  96. IDS_ERROR_PROCESS_NOTFOUND "ERROR: The process ""%s"" not found.\n"
  97. IDS_ERROR_TREE_KILL_FAILED "ERROR: The process with PID %d child of PID %d could not be terminated.\nReason: %s"
  98. IDS_ERROR_NO_PROCESSES "INFO: No tasks running with the specified criteria.\n"
  99. IDS_ERROR_UNABLE_TO_TERMINATE "Operation is not valid for this process. Return Code: %d.\n"
  100. IDS_ERROR_CRITICAL_SYSTEM_PROCESS "This is critical system process. Utility cannot end this process.\n"
  101. IDS_ERROR_CANNOT_KILL_SILENTLY "This process can only be terminated forcefully ( with /F option ).\n"
  102. IDS_ERROR_CANNOT_KILL_ITSELF "The process cannot terminate itself.\n"
  103. IDS_ERROR_TASK_HAS_CHILDS "One or more child processes of this process were still running.\n"
  104. IDS_ERROR_COM_ERROR "%s Error Code: 0x%08lx\n"
  105. IDS_ERROR_USERNAME_BUT_NOMACHINE "Invalid Syntax. /U can be specified only when /S is specified.\nType ""TASKKILL /?"" for usage.\n"
  106. IDS_ERROR_PASSWORD_BUT_NOUSERNAME "Invalid Syntax. /P can be specified only when /U is specified.\nType ""TASKKILL /?"" for usage.\n"
  107. IDS_ERROR_USERNAME_EMPTY "Invalid Syntax. User name should not be empty.\n"
  108. IDS_ERROR_SERVER_EMPTY "Invalid Syntax. System name should not be empty.\n"
  109. IDS_ERROR_WILDCARD_WITHOUT_FILTERS "Invalid Syntax. '*' is accepted only along with the filters.\nType ""TASKKILL /?"" for usage.\n"
  110. IDS_ERROR_PID_OR_IM_ONLY "Invalid Syntax. Either /PID or /IM are allowed but not both.\nType ""TASKKILL /?"" for usage.\n"
  111. IDS_ERROR_NO_PID_AND_IM "Invalid Syntax. Neither /FI nor /PID nor /IM are specified.\nType ""TASKKILL /?"" for usage.\n"
  112. IDS_ERROR_STRING_FOR_PID "Invalid Syntax. Specify valid numeric value for '/PID' option.\nType ""TASKKILL /?"" for usage.\n"
  113. IDS_ERROR_INVALID_USAGE_REQUEST "Invalid Syntax.\nType ""TASKKILL /?"" for usage.\n"
  114. IDS_ERROR_PLATFORM_SHOULD_BE_X86 "The specified command can be executed by 64-bit executable only.\n"
  115. END
  116. STRINGTABLE DISCARDABLE
  117. BEGIN
  118. IDS_MSG_TASKSINFO "Loading the tasks information ..."
  119. IDS_MSG_FORMINGTREE "Preparing the process tree ..."
  120. IDS_MSG_MODULESINFO "Loading the modules information. Please Wait. This may take few minutes ..."
  121. IDS_MSG_MODULESINFO_EX "Loading the modules information ( PID = %u ) ..."
  122. IDS_MSG_SERVICESINFO "Loading the services information ..."
  123. END
  124. //
  125. // Version resources
  126. //
  127. #include <ntverp.h>
  128. #define VER_FILETYPE VFT_APP
  129. #define VER_FILESUBTYPE VFT2_UNKNOWN
  130. #define VER_FILEDESCRIPTION_STR "Kill Process"
  131. #define VER_INTERNALNAME_STR "TaskKill.exe"
  132. #define VER_ORIGINALFILENAME_STR "TaskKill.exe"
  133. #include <common.ver>