Leaked source code of windows server 2003
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.

175 lines
9.1 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 "TASKLIST [/S system [/U username [/P [password]]]]\n"
  12. IDS_HELP_LINE2 " [/M [module] | /SVC | /V] [/FI filter] [/FO format] [/NH]\n"
  13. IDS_HELP_LINE3 "\n"
  14. IDS_HELP_LINE4 "Description:\n"
  15. IDS_HELP_LINE5 " This tool displays a list of currently running processes on\n"
  16. IDS_HELP_LINE6 " either a local or remote machine.\n"
  17. IDS_HELP_LINE7 ""
  18. IDS_HELP_LINE8 "\n"
  19. IDS_HELP_LINE9 "Parameter List:\n"
  20. IDS_HELP_LINE10 " /S system Specifies the remote system to connect to.\n\n"
  21. IDS_HELP_LINE11 " /U [domain\\]user Specifies the user context under which\n"
  22. IDS_HELP_LINE12 " the command should execute.\n\n"
  23. IDS_HELP_LINE13 " /P [password] Specifies the password for the given\n"
  24. IDS_HELP_LINE14 " user context. Prompts for input if omitted.\n\n"
  25. IDS_HELP_LINE15 " /M [module] Lists all tasks currently using the given\n"
  26. IDS_HELP_LINE16 " exe/dll name. If the module name is not\n"
  27. IDS_HELP_LINE17 " specified all loaded modules are displayed.\n\n"
  28. IDS_HELP_LINE18 ""
  29. IDS_HELP_LINE19 " /SVC Displays services hosted in each process.\n\n"
  30. IDS_HELP_LINE20 " /V Displays verbose task information.\n\n"
  31. IDS_HELP_LINE21 ""
  32. IDS_HELP_LINE22 " /FI filter Displays a set of tasks that match a\n"
  33. IDS_HELP_LINE23 " given criteria specified by the filter.\n\n"
  34. IDS_HELP_LINE24 " /FO format Specifies the output format.\n"
  35. IDS_HELP_LINE25 " Valid values: ""TABLE"", ""LIST"", ""CSV"".\n\n"
  36. IDS_HELP_LINE26 " /NH Specifies that the ""Column Header"" should\n"
  37. IDS_HELP_LINE27 " not be displayed in the output.\n"
  38. IDS_HELP_LINE28 " Valid only for ""TABLE"" and ""CSV"" formats.\n\n"
  39. IDS_HELP_LINE29 " /? Displays this help message.\n"
  40. IDS_HELP_LINE30 "\n"
  41. IDS_HELP_LINE31 "Filters:\n"
  42. IDS_HELP_LINE32 " Filter Name Valid Operators Valid Value(s)\n"
  43. IDS_HELP_LINE33 " ----------- --------------- --------------------------\n"
  44. IDS_HELP_LINE34 " STATUS eq, ne RUNNING | \n"
  45. IDS_HELP_LINE35 " NOT RESPONDING | UNKNOWN\n"
  46. IDS_HELP_LINE36 " IMAGENAME eq, ne Image name\n"
  47. IDS_HELP_LINE37 " PID eq, ne, gt, lt, ge, le PID value\n"
  48. IDS_HELP_LINE38 " SESSION eq, ne, gt, lt, ge, le Session number\n"
  49. IDS_HELP_LINE39 " SESSIONNAME eq, ne Session name\n"
  50. IDS_HELP_LINE40 " CPUTIME eq, ne, gt, lt, ge, le CPU time in the format\n"
  51. IDS_HELP_LINE41 " of hh:mm:ss.\n"
  52. IDS_HELP_LINE42 " hh - hours,\n"
  53. IDS_HELP_LINE43 " mm - minutes, ss - seconds\n"
  54. IDS_HELP_LINE44 " MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB\n"
  55. IDS_HELP_LINE45 " USERNAME eq, ne User name in [domain\\]user\n"
  56. IDS_HELP_LINE46 " format\n"
  57. IDS_HELP_LINE47 " SERVICES eq, ne Service name\n"
  58. IDS_HELP_LINE48 " WINDOWTITLE eq, ne Window title\n"
  59. IDS_HELP_LINE49 " MODULES eq, ne DLL name\n"
  60. IDS_HELP_LINE50 "\n"
  61. IDS_HELP_LINE51 "NOTE: ""WINDOWTITLE"" and ""STATUS"" filters are not supported when querying\n"
  62. IDS_HELP_LINE52 " a remote machine.\n\n"
  63. IDS_HELP_LINE53 "Examples:\n"
  64. IDS_HELP_LINE54 " TASKLIST\n"
  65. IDS_HELP_LINE55 " TASKLIST /M\n"
  66. IDS_HELP_LINE56 " TASKLIST /V /FO CSV\n"
  67. IDS_HELP_LINE57 " TASKLIST /SVC /FO LIST\n"
  68. IDS_HELP_LINE58 " TASKLIST /M wbem*\n"
  69. IDS_HELP_LINE59 " TASKLIST /S system /FO LIST\n"
  70. IDS_HELP_LINE60 " TASKLIST /S system /U domain\\username /FO CSV /NH\n"
  71. IDS_HELP_LINE61 " TASKLIST /S system /U username /P password /FO TABLE /NH\n"
  72. IDS_HELP_LINE62 " TASKLIST /FI ""USERNAME ne NT AUTHORITY\\SYSTEM"" /FI ""STATUS eq running""\n"
  73. END
  74. STRINGTABLE DISCARDABLE
  75. BEGIN
  76. IDS_OVALUES_FORMAT "list|table|csv"
  77. IDS_TEXT_FORMAT_LIST "list"
  78. IDS_TEXT_FORMAT_TABLE "table"
  79. IDS_TEXT_FORMAT_CSV "csv"
  80. END
  81. STRINGTABLE DISCARDABLE
  82. BEGIN
  83. IDS_FMT_KILOBYTE "%s K"
  84. IDS_VALUE_RUNNING "Running"
  85. IDS_VALUE_NOTRESPONDING "Not Responding"
  86. IDS_VALUE_UNKNOWN "Unknown"
  87. END
  88. STRINGTABLE DISCARDABLE
  89. BEGIN
  90. IDS_COLHEAD_HOSTNAME "Host Name"
  91. IDS_COLHEAD_STATUS "Status"
  92. IDS_COLHEAD_IMAGENAME "Image Name"
  93. IDS_COLHEAD_PID "PID"
  94. IDS_COLHEAD_SESSION "Session#"
  95. IDS_COLHEAD_USERNAME "User Name"
  96. IDS_COLHEAD_WINDOWTITLE "Window Title"
  97. IDS_COLHEAD_CPUTIME "CPU Time"
  98. IDS_COLHEAD_MEMUSAGE "Mem Usage"
  99. IDS_COLHEAD_SERVICES "Services"
  100. IDS_COLHEAD_SESSIONNAME "Session Name"
  101. IDS_COLHEAD_MODULES "Modules"
  102. IDS_COLWIDTH_HOSTNAME "16"
  103. IDS_COLWIDTH_STATUS "15"
  104. IDS_COLWIDTH_IMAGENAME "25"
  105. IDS_COLWIDTH_PID "6"
  106. IDS_COLWIDTH_SESSION "8"
  107. IDS_COLWIDTH_WINDOWTITLE "72"
  108. IDS_COLWIDTH_USERNAME "50"
  109. IDS_COLWIDTH_CPUTIME "12"
  110. IDS_COLWIDTH_MEMUSAGE "12"
  111. IDS_COLWIDTH_SERVICES "80"
  112. IDS_COLWIDTH_SERVICES_WRAP "45"
  113. IDS_COLWIDTH_SESSIONNAME "16"
  114. IDS_COLWIDTH_MODULES "80"
  115. IDS_COLWIDTH_MODULES_WRAP "45"
  116. END
  117. STRINGTABLE DISCARDABLE
  118. BEGIN
  119. IDS_FILTER_SESSIONNAME "sessionname"
  120. IDS_FILTER_STATUS "status"
  121. IDS_FILTER_IMAGENAME "imagename"
  122. IDS_FILTER_PID "pid"
  123. IDS_FILTER_SESSION "session"
  124. IDS_FILTER_CPUTIME "cputime"
  125. IDS_FILTER_MEMUSAGE "memusage"
  126. IDS_FILTER_USERNAME "username"
  127. IDS_FILTER_SERVICES "services"
  128. IDS_FILTER_WINDOWTITLE "windowtitle"
  129. IDS_FILTER_MODULES "modules"
  130. IDS_FVALUES_STATUS "running|not responding|unknown"
  131. IDS_PID_0_DOMAIN "NT AUTHORITY"
  132. IDS_PID_0_USERNAME "SYSTEM"
  133. IDS_OPERATORS_STRING " eq | ne "
  134. IDS_OPERATORS_NUMERIC " eq | ne | lt | gt | le | ge "
  135. IDS_FMT_MODULES_FILTER "modules eq %s"
  136. END
  137. STRINGTABLE DISCARDABLE
  138. BEGIN
  139. IDS_ERROR_INVALID_USAGE_REQUEST "Invalid syntax.\nType ""TASKLIST /?"" for usage.\n"
  140. IDS_ERROR_USERNAME_BUT_NOMACHINE "Invalid syntax. /U can be specified only when /S is specified.\nType ""TASKLIST /?"" for usage.\n"
  141. IDS_ERROR_PASSWORD_BUT_NOUSERNAME "Invalid syntax. /P can be specified only when /U is specified.\nType ""TASKLIST /?"" for usage.\n"
  142. IDS_ERROR_NODATA_AVAILABLE "INFO: No tasks are running which match the specified criteria.\n"
  143. IDS_ERROR_COM_ERROR "%s Error Code: 0x%08lx was returned.\n"
  144. IDS_ERROR_USERNAME_EMPTY "Invalid syntax. User name cannot be empty.\n"
  145. IDS_ERROR_SERVERNAME_EMPTY "Invalid syntax. System name cannot be empty.\n"
  146. IDS_ERROR_NH_NOTSUPPORTED "Invalid syntax. /NH option is allowed only for ""TABLE"" and ""CSV"" formats.\nType ""TASKLIST /?"" for usage.\n"
  147. IDS_ERROR_M_SVC_V_CANNOTBECOUPLED "Invalid syntax. /V, /M and /SVC options cannot be used together.\nType ""TASKLIST /?"" for usage.\n"
  148. IDS_ERROR_M_CHAR_AFTER_WILDCARD "Invalid syntax. No characters are allowed after '*' for /M option.\nType ""TASKLIST /?"" for usage.\n"
  149. IDS_WARNING_FILTERNOTSUPPORTED "\nWARNING: ""WINDOWTITLE"" and ""STATUS"" filters are not supported when querying a remote machine.\n"
  150. END
  151. //
  152. // Version resources
  153. //
  154. #include <ntverp.h>
  155. #define VER_FILETYPE VFT_APP
  156. #define VER_FILESUBTYPE VFT2_UNKNOWN
  157. #define VER_FILEDESCRIPTION_STR "Lists the current running tasks"
  158. #define VER_INTERNALNAME_STR "tasklist.exe"
  159. #define VER_ORIGINALFILENAME_STR "tasklist.exe"
  160. #include <common.ver>