#include #include "resource.h" #include "cmdlineres.h" #include "cmdline.rc" ///////////////////////////////////////////////////////////////////////////// // // String Table // STRINGTABLE DISCARDABLE BEGIN IDS_HELP_LINE1 "\nTASKKILL [/S system [/U username [/P [password]]]]\n" IDS_HELP_LINE2 " { [/FI filter] [/PID processid | /IM imagename] } [/F] [/T]\n" IDS_HELP_LINE3 "\n" IDS_HELP_LINE4 "Description:\n" IDS_HELP_LINE5 " This command line tool can be used to end one or more processes.\n" IDS_HELP_LINE6 " Processes can be killed by the process id or image name.\n" IDS_HELP_LINE7 "\n" IDS_HELP_LINE8 "Parameter List:\n" IDS_HELP_LINE9 " /S system Specifies the remote system to connect to.\n\n" IDS_HELP_LINE10 " /U [domain\\]user Specifies the user context under which\n" IDS_HELP_LINE11 " the command should execute.\n\n" IDS_HELP_LINE12 " /P [password] Specifies the password for the given\n" IDS_HELP_LINE13 " user context. Prompts for input if omitted.\n\n" IDS_HELP_LINE14 " /F Specifies to forcefully terminate\n" IDS_HELP_LINE15 " process(es).\n\n" IDS_HELP_LINE16 " /FI filter Displays a set of tasks that match a\n" IDS_HELP_LINE17 " given criteria specified by the filter.\n\n" IDS_HELP_LINE18 " /PID process id Specifies the PID of the process that\n" IDS_HELP_LINE19 " has to be terminated.\n\n" IDS_HELP_LINE20 " /IM image name Specifies the image name of the process\n" IDS_HELP_LINE21 " that has to be terminated. Wildcard '*'\n" IDS_HELP_LINE22 " can be used to specify all image names.\n\n" IDS_HELP_LINE23 " /T Tree kill: terminates the specified process\n" IDS_HELP_LINE24 " and any child processes which were started by it.\n\n" IDS_HELP_LINE25 " /? Displays this help/usage.\n" IDS_HELP_LINE26 "\n" IDS_HELP_LINE27 "Filters:\n" IDS_HELP_LINE28 " Filter Name Valid Operators Valid Value(s)\n" IDS_HELP_LINE29 " ----------- --------------- --------------\n" IDS_HELP_LINE30 " STATUS eq, ne RUNNING | NOT RESPONDING\n" IDS_HELP_LINE31 " IMAGENAME eq, ne Image name\n" IDS_HELP_LINE32 " PID eq, ne, gt, lt, ge, le PID value\n" IDS_HELP_LINE33 " SESSION eq, ne, gt, lt, ge, le Session number.\n" IDS_HELP_LINE34 " CPUTIME eq, ne, gt, lt, ge, le CPU time in the format\n" IDS_HELP_LINE35 " of hh:mm:ss.\n" IDS_HELP_LINE36 " hh - hours,\n" IDS_HELP_LINE37 " mm - minutes, ss - seconds\n" IDS_HELP_LINE38 " MEMUSAGE eq, ne, gt, lt, ge, le Memory usage in KB\n" IDS_HELP_LINE39 " USERNAME eq, ne User name in [domain\\]user\n" IDS_HELP_LINE40 " format\n" IDS_HELP_LINE41 " MODULES eq, ne DLL name\n" IDS_HELP_LINE42 " SERVICES eq, ne Service name\n" IDS_HELP_LINE43 " WINDOWTITLE eq, ne Window title\n" IDS_HELP_LINE44 "\n" IDS_HELP_LINE45 "NOTE: Wildcard '*' for the /IM switch is accepted only with filters.\n\n" IDS_HELP_LINE46 "NOTE: Termination of remote processes will always be done forcefully\n" IDS_HELP_LINE47 " irrespective of whether /F option is specified or not.\n\n" IDS_HELP_LINE48 "Examples:\n" IDS_HELP_LINE49 " TASKKILL /S system /F /IM notepad.exe /T\n" IDS_HELP_LINE50 " TASKKILL /PID 1230 /PID 1241 /PID 1253 /T\n" IDS_HELP_LINE51 " TASKKILL /F /IM notepad.exe /IM mspaint.exe\n" IDS_HELP_LINE52 " TASKKILL /F /FI ""PID ge 1000"" /FI ""WINDOWTITLE ne untitle*""\n" IDS_HELP_LINE53 " TASKKILL /F /FI ""USERNAME eq NT AUTHORITY\\SYSTEM"" /IM notepad.exe\n" IDS_HELP_LINE54 " TASKKILL /S system /U domain\\username /FI ""USERNAME ne NT*"" /IM *\n" IDS_HELP_LINE55 " TASKKILL /S system /U username /P password /FI ""IMAGENAME eq note*""\n" END STRINGTABLE DISCARDABLE BEGIN IDS_FILTER_STATUS "status" IDS_FILTER_IMAGENAME "imagename" IDS_FILTER_PID "pid" IDS_FILTER_SESSION "session" IDS_FILTER_CPUTIME "cputime" IDS_FILTER_MEMUSAGE "memusage" IDS_FILTER_USERNAME "username" IDS_FILTER_SERVICES "services" IDS_FILTER_WINDOWNAME "windowtitle" IDS_FILTER_MODULES "modules" IDS_FVALUES_STATUS "running|not responding" IDS_OPERATORS_STRING " eq | ne " IDS_OPERATORS_NUMERIC " eq | ne | lt | gt | le | ge " IDS_VALUE_RUNNING "Running" IDS_VALUE_NOTRESPONDING "Not Responding" IDS_PID_0_DOMAIN "NT AUTHORITY" IDS_PID_0_USERNAME "SYSTEM" END STRINGTABLE DISCARDABLE BEGIN IDS_MSG_KILL_SUCCESS "SUCCESS: The process with PID %d has been terminated.\n" IDS_MSG_KILL_SUCCESS_QUEUED "SUCCESS: The process with PID %d has been queued for termination.\n" IDS_MSG_KILL_SUCCESS_EX "SUCCESS: The process ""%s"" with PID %d has been terminated.\n" IDS_MSG_KILL_SUCCESS_QUEUED_EX "SUCCESS: The process ""%s"" with PID %d has been queued for termination.\n" IDS_MSG_TREE_KILL_SUCCESS "SUCCESS: The process with PID %d child of PID %d has been terminated.\n" IDS_ERROR_KILL_FAILED "ERROR: The process with PID %d could not be terminated.\nReason: %s" IDS_ERROR_KILL_FAILED_EX "ERROR: The process ""%s"" with PID %d could not be terminated.\nReason: %s" IDS_ERROR_PROCESS_NOTFOUND "ERROR: The process ""%s"" not found.\n" IDS_ERROR_TREE_KILL_FAILED "ERROR: The process with PID %d child of PID %d could not be terminated.\nReason: %s" IDS_ERROR_NO_PROCESSES "INFO: No tasks running with the specified criteria.\n" IDS_ERROR_UNABLE_TO_TERMINATE "Operation is not valid for this process. Return Code: %d.\n" IDS_ERROR_CRITICAL_SYSTEM_PROCESS "This is critical system process. Utility cannot end this process.\n" IDS_ERROR_CANNOT_KILL_SILENTLY "This process can only be terminated forcefully ( with /F option ).\n" IDS_ERROR_CANNOT_KILL_ITSELF "The process cannot terminate itself.\n" IDS_ERROR_TASK_HAS_CHILDS "One or more child processes of this process were still running.\n" IDS_ERROR_COM_ERROR "%s Error Code: 0x%08lx\n" IDS_ERROR_USERNAME_BUT_NOMACHINE "Invalid Syntax. /U can be specified only when /S is specified.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_PASSWORD_BUT_NOUSERNAME "Invalid Syntax. /P can be specified only when /U is specified.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_USERNAME_EMPTY "Invalid Syntax. User name should not be empty.\n" IDS_ERROR_SERVER_EMPTY "Invalid Syntax. System name should not be empty.\n" IDS_ERROR_WILDCARD_WITHOUT_FILTERS "Invalid Syntax. '*' is accepted only along with the filters.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_PID_OR_IM_ONLY "Invalid Syntax. Either /PID or /IM are allowed but not both.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_NO_PID_AND_IM "Invalid Syntax. Neither /FI nor /PID nor /IM are specified.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_STRING_FOR_PID "Invalid Syntax. Specify valid numeric value for '/PID' option.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_INVALID_USAGE_REQUEST "Invalid Syntax.\nType ""TASKKILL /?"" for usage.\n" IDS_ERROR_PLATFORM_SHOULD_BE_X86 "The specified command can be executed by 64-bit executable only.\n" END STRINGTABLE DISCARDABLE BEGIN IDS_MSG_TASKSINFO "Loading the tasks information ..." IDS_MSG_FORMINGTREE "Preparing the process tree ..." IDS_MSG_MODULESINFO "Loading the modules information. Please Wait. This may take few minutes ..." IDS_MSG_MODULESINFO_EX "Loading the modules information ( PID = %u ) ..." IDS_MSG_SERVICESINFO "Loading the services information ..." END // // Version resources // #include #define VER_FILETYPE VFT_APP #define VER_FILESUBTYPE VFT2_UNKNOWN #define VER_FILEDESCRIPTION_STR "Kill Process" #define VER_INTERNALNAME_STR "TaskKill.exe" #define VER_ORIGINALFILENAME_STR "TaskKill.exe" #include