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.

330 lines
11 KiB

  1. #include "netsh.h"
  2. #include "strdefs.h"
  3. STRINGTABLE
  4. {
  5. MSG_NULL, ""
  6. MSG_OKAY, "Ok.\n"
  7. //
  8. // Error messages
  9. //
  10. ERROR_INVALID_SYNTAX, "\
  11. The syntax supplied for this command is not valid. Check help for the correct syntax.\n"
  12. ERROR_PROTOCOL_NOT_IN_TRANSPORT, "\
  13. First, add the protocol to the transport, and then add it to the interface.\n"
  14. ERROR_NO_CHANGE, "\
  15. No change was made.\n"
  16. ERROR_CMD_NOT_FOUND, "\
  17. The following command was not found: %1!s!.\n"
  18. ERROR_ENTRY_PT_NOT_FOUND, "\
  19. The following entry point is not available in the helper: %1!s!.\n"
  20. ERROR_DLL_LOAD_FAILED, "\
  21. The following helper DLL cannot be loaded: %1!s!.\n"
  22. ERROR_INIT_DISPLAY, "\
  23. The netsh console cannot be initialized for display.\n"
  24. ERROR_TAG_ALREADY_PRESENT, "\
  25. Two or more arguments in the command have the same name.\n"
  26. ERROR_INVALID_OPTION_TAG, "\
  27. '%1!s!' is not a valid argument for this command.\n"
  28. ERROR_INVALID_OPTION_VALUE, "\
  29. '%1!s!' is not an acceptable value for '%2!s!'.\n"
  30. ERROR_NO_TAG, "\
  31. Expected a value for '%1!s!'\n"
  32. ERROR_MISSING_OPTION, "\
  33. One or more essential parameters were not entered.\n\
  34. Verify the required parameters, and reenter them.\n"
  35. ERROR_TRANSPORT_NOT_PRESENT, "\
  36. The requested transport is not available.\n"
  37. ERROR_HELPER_ALREADY_REGISTERED, "\
  38. This helper has already been registered.\n"
  39. ERROR_CONTEXT_ALREADY_REGISTERED, "\
  40. This context has already been registered.\n"
  41. HLP_GROUP_ADD, "Adds a configuration entry to a list of entries.\n"
  42. HLP_GROUP_DELETE, "Deletes a configuration entry from a list of entries.\n"
  43. HLP_GROUP_SET, "Updates configuration settings.\n"
  44. HLP_GROUP_SHOW, "Displays information.\n"
  45. HLP_HELP1, "Displays a list of commands.\n"
  46. HLP_HELP1_EX, "\
  47. \nUsage: %1!s!\n\
  48. \nRemarks:\
  49. \n Displays a list of commands.\n"
  50. HLP_DUMP, "Displays a configuration script.\n"
  51. HLP_DUMP_EX, "\
  52. \nUsage: %1!s!\n\
  53. \nRemarks:\
  54. \n Creates a script that contains the current configuration. If saved to a\
  55. \n file, this script can be used to restore altered configuration settings.\
  56. \n"
  57. MSG_ALIAS_NOT_FOUND, "The following alias was not found: %1!s!.\n"
  58. MSG_CMD_FAILED, "The command cannot be executed.\n"
  59. MSG_NOT_ENOUGH_MEMORY, "There is not enough memory available to complete this action.\n"
  60. MSG_DLL_LOAD_FAILED, "The following helper DLL cannot be loaded: %1!s!.\n"
  61. MSG_DLL_START_FAILED, "Initialization Function %1!s! in %2!s! failed to start with error code %3!d!\n"
  62. MSG_OPEN_FAILED, "Windows cannot open the file named %1!s!.\n"
  63. MSG_COMMIT_ERROR, "The commit call to %1!s! cannot be completed.\n"
  64. MSG_NETSH_USAGE, "\
  65. \nUsage: %1!s! [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\\]UserName] [-p Password | *]\
  66. \n [Command | -f ScriptFile]\n"
  67. MSG_NETSH_LOGIN_PASSWORD "Type the password for '%1!s!': "
  68. MSG_HELP_FOOTER, "\n\
  69. To view help for a command, type the command, followed by a space, and then\
  70. \n type %1!s!.\n"
  71. MSG_GLOBAL_COMMANDS, "\nGlobal commands:\n"
  72. MSG_INHERITED_COMMANDS, "\n\
  73. Commands inherited from the %1!s! context:\n"
  74. MSG_LOCAL_COMMANDS, "\nCommands in this context:\n"
  75. MSG_INVALID_TOPLEVEL_CMD "\n\
  76. Invalid Top Level command name: %1!s!\n"
  77. MSG_INVALID_CMD_GROUP "\n\
  78. Invalid command group name: %1!s!\n"
  79. MSG_INVALID_CMD "\n\
  80. Invalid command name: %1!s!\n"
  81. HLP_ADD_HELPER, "Installs a helper DLL.\n"
  82. HLP_DEL_HELPER, "Removes a helper DLL.\n"
  83. MSG_HELPER_HELP, "Changes to the `%2!s!%3!s!%1!s!' context.\n"
  84. MSG_SHELL_CMD_HELP_HEADER, "\n\
  85. The following commands are available:\n"
  86. MSG_WARN_COULDNOTVERCHECKHOST, "\n\
  87. WARNING: Could not obtain host information from machine: [%1!s!]. Some commands may not be available.\n"
  88. MSG_SUBCONTEXT_LIST, "\n\
  89. The following sub-contexts are available:\n"
  90. HLP_ALIAS, "Adds an alias.\n"
  91. HLP_ALIAS_EX, "\n\
  92. Usage : %1!s! [alias-name] [string1 string 2 ...]\n\n\
  93. \t If no arguments are specified, all aliases will be displayed.\n\
  94. \t If alias-name is specified, then the equivalent string for it\n\
  95. \t will be displayed (if found).\n\
  96. \t If one or more strings are specified, then alias-name is set to \n\
  97. \t these strings.\n\n"
  98. HLP_UNALIAS, "Deletes an alias.\n"
  99. HLP_UNALIAS_EX, "\n\
  100. Usage : %1!s! alias-name\n\n\
  101. \t Deletes alias alias-name.\n\n"
  102. HLP_UPLEVEL, "Goes up one context level.\n"
  103. HLP_UPLEVEL_EX, "\n\
  104. Usage : %1!s!\n\n\
  105. \t Goes up one context level.\n\n"
  106. HLP_PUSHD, "Pushes current context on stack.\n"
  107. HLP_PUSHD_EX, "\n\
  108. Usage : %1!s!\n\n\
  109. \t Pushes current context on stack.\n\n"
  110. HLP_POPD, "Pops a context from the stack.\n"
  111. HLP_POPD_EX, "\n\
  112. Usage : %1!s!\n\n\
  113. \t Pops a context from the stack.\n\n"
  114. HLP_COMMIT, "Sets the current mode to online.\n"
  115. HLP_COMMIT_EX, "\n\
  116. Usage: %1!s!\n\n\
  117. Remarks:\
  118. \n Sets the current mode to online. Changes made while in online mode are\
  119. \n immediately reflected in the running configuration. If changes are\
  120. \n made while in offline mode, they are reflected in the running\
  121. \n configuration when the mode is switched back to online.\n"
  122. HLP_UNCOMMIT, "Sets the current mode to offline.\n"
  123. HLP_UNCOMMIT_EX, "\n\
  124. Usage: %1!s!\n\n\
  125. Remarks:\
  126. \n Sets the current mode to offline. Changes made while in offline mode\
  127. \n are saved and made in the running configuration when the mode is\
  128. \n switched back to online.\n"
  129. HLP_SAVE, "Commits changes made while in offline mode.\n"
  130. HLP_SAVE_EX, "\n\
  131. Usage: %1!s!\n\n\
  132. Remarks:\
  133. \n Commits changes to the running configuration that were made while in\
  134. \n offline mode. No action is taken for this command while in online\
  135. \n mode.\n"
  136. HLP_LOAD, "Runs a script file.\n"
  137. HLP_LOAD_EX, "\n\
  138. Usage: %1!s! <ScriptFile>\n\n\
  139. Remarks:\
  140. \n Loads the script file and runs it.\n"
  141. HLP_SET_FILE, "Copy the console output to a file.\n"
  142. HLP_SET_FILE_EX, "\n\
  143. Usage: %1!s! [ mode= ] { open [ name= ] <filename> | append [ name = ] \n\
  144. <filename> | close }\n\n\
  145. Parameters:\n\
  146. \n Tag Value \
  147. \n mode - One of the following values:\
  148. \n open: Creates a new file or overwrites an existing file and \
  149. \n streams the console output to the file \
  150. \n append: Opens an existing file and streams the console \
  151. \n output to the end of the existing file \
  152. \n close: Stops streaming and closes a file \
  153. \n name - Name of the file (full path optional)\
  154. \n\
  155. Remarks:\
  156. \n Copy the console output to a file.\n\
  157. Example:\
  158. \n %1!s! open c:\logfiles\logfile.txt \
  159. \n The above command creates a file and logs all output to it.\n"
  160. HLP_SET_MODE, "Sets the current mode to online or offline.\n"
  161. HLP_SET_MODE_EX, "\n\
  162. Usage: %1!s! [ mode= ] { online | offline }\n\n\
  163. Parameters:\n\
  164. \n Tag Value\
  165. \n mode - One of the following values:\
  166. \n online: Commit changes immediately\
  167. \n offline: Delay commit until explicitly requested\n\n\
  168. Remarks:\
  169. \n Sets the current mode to online or offline.\n"
  170. HLP_SET_MACHINE, "Sets the current machine on which to operate.\n"
  171. HLP_SET_MACHINE_EX, "\n\
  172. Usage: %1!s! [name=]<string> [user=][[DomainName\\]UserName] [pwd=][Password | *]\n\n\
  173. Parameters:\n\
  174. \n Tag Value\
  175. \n name - Name of the machine on which to operate\
  176. \n user - User name used to connect to remote machine\
  177. \n pwd - Password used to connect to remote machine\n\n\
  178. Remarks:\
  179. \n Sets the current machine on which to operate. If a machine name\
  180. \n is not specified, the local machine is used. A username and password \
  181. \n cannot be used to connect to the local machine.\n"
  182. HLP_SHOW_ALIAS, "Lists all defined aliases.\n"
  183. HLP_SHOW_ALIAS_EX, "\n\
  184. Usage: %1!s!\n\
  185. Remarks:\
  186. \n Lists all defined aliases.\n"
  187. HLP_SHOW_HELPER, "Lists all the top-level helpers.\n"
  188. HLP_SHOW_HELPER_EX, "\n\
  189. Usage: %1!s!\n\
  190. Remarks:\
  191. \n Lists all the top-level helpers.\n"
  192. MSG_SHOW_HELPER_HDR, "\
  193. Helper GUID DLL Filename Command\n\
  194. -------------------------------------- ------------ -------\n"
  195. MSG_SHOW_HELPER_INFO, "%1!s! %2!-12s! "
  196. MSG_SHOW_HELPER_INFO1, " "
  197. MSG_SHOW_HELPER_INFO2, "%1!s!\n"
  198. MSG_SHOW_HELPER_DLL_HDR, "\nThe following DLLs could not be loaded:\n"
  199. MSG_SHOW_HELPER_ORPHAN_HDR, "\n\
  200. The following helpers could not be started:\n\n\
  201. GUID of Orphaned Helper DLL Filename GUID of Missing Parent\n\
  202. -------------------------------------- ------------ ----------------------\n"
  203. MSG_SHOW_HELPER_ORPHAN_INFO, "%1!s! %2!-12s! %3!s!\n"
  204. HLP_SHOW_MODE, "Shows the current mode.\n"
  205. HLP_SHOW_MODE_EX, "\n\
  206. \t Shows the current mode (offline or online).\n\n"
  207. HLP_ADD_HELPER_EX, "\n\
  208. Usage: %1!s! <DllFileName>\n\n\
  209. Remarks:\
  210. \n Installs the specified helper DLL in netsh.\n\n\
  211. Example:\
  212. \n %1!s! ipmontr.dll\n\
  213. \n The above command installs ipmontr.dll in netsh."
  214. HLP_DEL_HELPER_EX, "\n\
  215. Usage: %1!s! <DllFileName>\n\n\
  216. Remarks:\
  217. \n Removes the specified helper DLL from netsh. Note that after a helper\
  218. \n is removed, it is no longer supported by netsh.\n"
  219. HLP_FLUSH, "Discards changes made while in offline mode.\n"
  220. HLP_FLUSH_EX, "\n\
  221. Usage: %1!s!\n\n\
  222. Remarks:\
  223. \n Discards changes made while in the offline mode. This does not affect\
  224. \n changes made while in online mode.\n"
  225. HLP_EXIT, "Exits the program.\n"
  226. HLP_EXIT_EX, "\n\
  227. \t Exits the program.\n\n"
  228. EMSG_INSTALL_KEY_FAILED, "Error creating key for %1!s! in the registry.\n"
  229. EMSG_UNINSTALL_KEY_FAILED, "Error deleting key for %1!s! in the registry.\n"
  230. EMSG_ALIASING_KEYWORD, "Cannot redefine a built-in command.\n"
  231. EMSG_REMOTE_CONNECT_FAILED, "Could not connect to %1!s!.\n"
  232. EMSG_INCOMPLETE_COMMAND, "\
  233. The command is incomplete. The possible completions are:\n\n"
  234. EMSG_DLL_FN_NOT_FOUND, "\
  235. The function %1!s! was not found in %2!s!.\n"
  236. }
  237. #include <windows.h>
  238. #include <ntverp.h>
  239. #define VER_FILETYPE VFT_APP
  240. #define VER_FILESUBTYPE VFT2_UNKNOWN
  241. #define VER_FILEDESCRIPTION_STR "Network Command Shell"
  242. #define VER_INTERNALNAME_STR "netsh.exe"
  243. #define VER_ORIGINALFILENAME_STR "netsh.exe"
  244. #include "common.ver" // NT5.0 version file.