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.

196 lines
13 KiB

  1. #include "resource.h"
  2. #include "cmdlineres.h"
  3. #include "cmdline.h"
  4. #include "cmdline.rc"
  5. STRINGTABLE DISCARDABLE
  6. BEGIN
  7. IDS_SETX_HELP_BEGIN "\nSetX has three ways of working: \n\nSyntax 1:\n"
  8. IDS_SETX_HELP_1 " SETX [/S system [/U [domain\\]user [/P [password]]]] var value [/M]\n\n"
  9. IDS_SETX_HELP_2 ""
  10. IDS_SETX_HELP_3 "Syntax 2:\n"
  11. IDS_SETX_HELP_4 " SETX [/S system [/U [domain\\]user [/P [password]]]] var /K regpath [/M]\n\n"
  12. IDS_SETX_HELP_5 ""
  13. IDS_SETX_HELP_6 ""
  14. IDS_SETX_HELP_7 "Syntax 3:\n"
  15. IDS_SETX_HELP_8 " SETX [/S system [/U [domain\\]user [/P [password]]]]\n"
  16. IDS_SETX_HELP_9 ""
  17. IDS_SETX_HELP_10 " /F file {var {/A x,y | /R x,y string}[/M] | /X} [/D delimiters]\n\n"
  18. IDS_SETX_HELP_11 "Description:\n"
  19. IDS_SETX_HELP_12 " Creates or modifies environment variables in the user or system\n"
  20. IDS_SETX_HELP_13 " environment. Can set variables based on arguments, regkeys or\n"
  21. IDS_SETX_HELP_14 " file input.\n\n"
  22. IDS_SETX_HELP_15 ""
  23. IDS_SETX_HELP_16 "Parameter List:\n"
  24. IDS_SETX_HELP_17 " /S system Specifies the remote system to connect to.\n\n"
  25. IDS_SETX_HELP_18 ""
  26. IDS_SETX_HELP_19 " /U [domain\\]user Specifies the user context under which\n"
  27. IDS_SETX_HELP_20 " the command should execute.\n\n"
  28. IDS_SETX_HELP_21 ""
  29. IDS_SETX_HELP_22 " /P [password] Specifies the password for the given\n"
  30. IDS_SETX_HELP_23 " user context. Prompts for input if omitted.\n\n"
  31. IDS_SETX_HELP_24 ""
  32. IDS_SETX_HELP_25 " var Specifies the environment variable to set.\n\n"
  33. IDS_SETX_HELP_26 ""
  34. IDS_SETX_HELP_27 " value Specifies a value to be assigned to the \n"
  35. IDS_SETX_HELP_28 " environment variable.\n\n"
  36. IDS_SETX_HELP_29 ""
  37. IDS_SETX_HELP_30 " /K regpath Specifies that the variable is set based\n"
  38. IDS_SETX_HELP_31 " on information from a registry key.\n"
  39. IDS_SETX_HELP_32 " Path should be specified in the format of\n"
  40. IDS_SETX_HELP_33 " hive\\key\\...\\value. For example,\n"
  41. IDS_SETX_HELP_34 " HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\\n"
  42. IDS_SETX_HELP_35 " Control\\TimeZoneInformation\\StandardName.\n\n"
  43. IDS_SETX_HELP_36 ""
  44. IDS_SETX_HELP_37 " /F file Specifies the filename of the text file\n"
  45. IDS_SETX_HELP_38 " to use.\n\n"
  46. IDS_SETX_HELP_39 ""
  47. IDS_SETX_HELP_40 " /A x,y Specifies absolute file coordinates\n"
  48. IDS_SETX_HELP_41 " (line X, item Y) as parameters to search \n"
  49. IDS_SETX_HELP_42 " within the file.\n\n"
  50. IDS_SETX_HELP_43 ""
  51. IDS_SETX_HELP_44 " /R x,y string Specifies relative file coordinates with\n"
  52. IDS_SETX_HELP_45 " respect to ""string"" as the search parameters.\n\n"
  53. IDS_SETX_HELP_46 ""
  54. IDS_SETX_HELP_47 " /M Specifies that the variable should be set in\n"
  55. IDS_SETX_HELP_48 " the system wide (HKEY_LOCAL_MACHINE)\n"
  56. IDS_SETX_HELP_49 " environment. The default is to set the\n"
  57. IDS_SETX_HELP_50 " variable under the HKEY_CURRENT_USER \n"
  58. IDS_SETX_HELP_51 " environment.\n\n"
  59. IDS_SETX_HELP_52 ""
  60. IDS_SETX_HELP_53 " /X Displays file contents with x,y coordinates.\n\n"
  61. IDS_SETX_HELP_54 ""
  62. IDS_SETX_HELP_55 " /D delimiters Specifies additional delimiters such as "",""\n"
  63. IDS_SETX_HELP_56 " or ""\\"". The built-in delimiters are space,\n"
  64. IDS_SETX_HELP_57 " tab, carriage return, and linefeed. Any \n"
  65. IDS_SETX_HELP_58 " ASCII character can be used as an additional\n"
  66. IDS_SETX_HELP_59 " delimiter. The maximum number of delimiters,\n"
  67. IDS_SETX_HELP_60 " including the built-in delimiters, is 15.\n\n"
  68. IDS_SETX_HELP_61 ""
  69. IDS_SETX_HELP_62 " /? Displays this help message.\n\n"
  70. IDS_SETX_HELP_63 ""
  71. IDS_SETX_HELP_64 "NOTE: 1) SETX writes variables to the master environment in the registry.\n\n"
  72. IDS_SETX_HELP_65 ""
  73. IDS_SETX_HELP_66 ""
  74. IDS_SETX_HELP_67 " 2) On a local system, variables created or modified by this tool\n"
  75. IDS_SETX_HELP_68 " will be available in future command windows but not in the\n"
  76. IDS_SETX_HELP_69 " current CMD.exe command window.\n\n"
  77. IDS_SETX_HELP_70 ""
  78. IDS_SETX_HELP_71 " 3) On a remote system, variables created or modified by this tool\n"
  79. IDS_SETX_HELP_72 " will be available at the next logon session.\n\n"
  80. IDS_SETX_HELP_73 ""
  81. IDS_SETX_HELP_74 " 4) The valid Registry Key data types are REG_DWORD, REG_EXPAND_SZ,\n"
  82. IDS_SETX_HELP_75 " REG_SZ, REG_MULTI_SZ.\n\n"
  83. IDS_SETX_HELP_76 ""
  84. IDS_SETX_HELP_77 " 5) Supported hives: HKEY_LOCAL_MACHINE (HKLM),\n"
  85. IDS_SETX_HELP_78 " HKEY_CURRENT_USER (HKCU).\n\n"
  86. IDS_SETX_HELP_79 ""
  87. IDS_SETX_HELP_80 " 6) Delimiters are case sensitive.\n\n"
  88. IDS_SETX_HELP_81 ""
  89. IDS_SETX_HELP_82 " 7) REG_DWORD values are extracted from the registry in decimal \n"
  90. IDS_SETX_HELP_83 " format.\n\n"
  91. IDS_SETX_HELP_84 ""
  92. IDS_SETX_HELP_85 ""
  93. IDS_SETX_HELP_86 "Examples:\n"
  94. IDS_SETX_HELP_87 " SETX MACHINE COMPAQ \n"
  95. IDS_SETX_HELP_88 " SETX MACHINE ""COMPAQ COMPUTER"" /M\n"
  96. IDS_SETX_HELP_89 " SETX MYPATH ""%PATH%""\n"
  97. IDS_SETX_HELP_90 " SETX MYPATH ~PATH~\n"
  98. IDS_SETX_HELP_91 " SETX /S system /U user /P password MACHINE COMPAQ \n"
  99. IDS_SETX_HELP_92 " SETX /S system /U user /P password MYPATH ^%PATH^% \n"
  100. IDS_SETX_HELP_93 " SETX TZONE /K HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\\n"
  101. IDS_SETX_HELP_94 " Control\\TimeZoneInformation\\StandardName\n"
  102. IDS_SETX_HELP_95 " SETX BUILD /K ""HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\n"
  103. IDS_SETX_HELP_96 " NT\\CurrentVersion\\CurrentBuildNumber"" /M\n"
  104. IDS_SETX_HELP_97 " SETX /S system /U user /P password TZONE /K HKEY_LOCAL_MACHINE\\\n"
  105. IDS_SETX_HELP_98 " System\\CurrentControlSet\\Control\\TimeZoneInformation\\\n"
  106. IDS_SETX_HELP_99 " StandardName\n"
  107. IDS_SETX_HELP_100 " SETX /S system /U user /P password BUILD /K \n"
  108. IDS_SETX_HELP_101 " ""HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows NT\\\n"
  109. IDS_SETX_HELP_102 " CurrentVersion\\CurrentBuildNumber"" /M\n"
  110. IDS_SETX_HELP_103 " SETX /F ipconfig.out /X \n"
  111. IDS_SETX_HELP_104 " SETX IPADDR /F ipconfig.out /A 5,11 \n"
  112. IDS_SETX_HELP_105 " SETX OCTET1 /F ipconfig.out /A 5,3 /D ""#$*."" \n"
  113. IDS_SETX_HELP_106 " SETX IPGATEWAY /F ipconfig.out /R 0,7 Gateway\n"
  114. IDS_SETX_HELP_107 " SETX /S system /U user /P password /F c:\ipconfig.out /X\n"
  115. IDS_SETX_HELP_END ""
  116. END
  117. STRINGTABLE DISCARDABLE
  118. BEGIN
  119. IDS_ERROR_SYNTAX "ERROR: Invalid syntax.\nType ""SETX /?"" for usage.\n"
  120. IDS_ERROR_FILE_NOT_FOUND "ERROR: The system cannot find registry path specified.\n"
  121. IDS_ERROR_PATH_NOT_FOUND "ERROR: The system cannot find the path specified.\n"
  122. IDS_ERROR_ACCESS_DENIED "ERROR: Access to the registry path is denied.\n"
  123. IDS_ERROR_INVALID_HANDLE "ERROR: The handle is invalid.\n"
  124. IDS_ERROR_NOT_ENOUGH_MEMORY "ERROR: Not enough storage is available to process this command.\n"
  125. IDS_ERROR_BAD_ENVIRONMENT "ERROR: The environment is incorrect.\n"
  126. IDS_ERROR_INVALID_ACCESS "ERROR: The access code is invalid.\n"
  127. IDS_ERROR_INVALID_DATA "ERROR: The data is invalid.\n"
  128. IDS_ERROR_INVALID_DRIVE "ERROR: The system cannot find the drive specified.\n"
  129. IDS_REGDB_E_READREGDB "ERROR: Could not read the key from registry.\n"
  130. IDS_REGDB_E_WRITEREGDB "ERROR: Could not write the key to registry.\n"
  131. IDS_REGDB_E_KEYMISSING "ERROR: Could not find the key in the registry.\n"
  132. IDS_ERROR_5010 "ERROR: Must provide valid row,column.\n"
  133. IDS_ERROR_5011 "ERROR: Must provide valid row,column and ""STRING"".\n"
  134. IDS_ERROR_5012 "ERROR: Coordinates %s do not exist or specified text not found.\n"
  135. IDS_ERROR_5013 "ERROR: Must provide a valid search string for relative searches.\n"
  136. IDS_ERROR_5014 "ERROR: Coordinates cannot be NULL.\n "
  137. IDS_ERROR_5015 "ERROR: Invalid characters used as coordinates ""%s"".\n"
  138. IDS_ERROR_5016 "ERROR: Cannot convert value %s to integer.\n"
  139. IDS_ERROR_5017 "ERROR: No search string provided for a relative search.\n"
  140. IDS_ERROR_5018 "ERROR: Coordinates %s do not exist.\n"
  141. IDS_ERROR_5020 "ERROR: Too many delimiters specified (%s) ! - Maximum is 15.\n"
  142. IDS_ERROR_5030 "ERROR: Cannot open text file ""%s"".\n"
  143. IDS_ERROR_5031 "ERROR: No filename specified.\n"
  144. IDS_ERROR_5032 "ERROR: Specified file is not plain text.\n"
  145. IDS_ERROR_5040 "ERROR: Invalid Hive specified. Valid values are HKEY_LOCAL_MACHINE(or HKLM) or HKEY_CURRENT_USER(or HKCU).\n"
  146. IDS_ERROR_5041 "ERROR: Only REG_DWORD, REG_EXPAND_SZ, REG_SZ, REG_MULTI_SZ are supported.\n"
  147. IDS_ERROR_5042 "ERROR: Bad format for supplied key: %s.\n"
  148. IDS_ERROR_DEFAULT "ERROR: The specified operation could not be completed.\n"
  149. IDS_NULL_SERVER "ERROR: /S cannot be empty.\n"
  150. IDS_NULL_USER "ERROR: /U cannot be empty.\n"
  151. IDS_NULL_FILE "ERROR: /F cannot be empty.\n"
  152. IDS_USER_BUT_NOMACHINE "ERROR: Invalid syntax. Username specified without specifying system name.\n";
  153. IDS_PASSWD_BUT_NOUSER "ERROR: Invalid syntax. Password specified without specifying user name.\n";
  154. IDS_SETX_SYNTAX "ERROR: Invalid syntax.\nType ""SETX /?"" for usage.\n"
  155. IDS_INVALID_ARG "ERROR: Invalid arguments.\n"
  156. IDS_INVALID_LENGTH "ERROR: The value cannot exceed 1024 characters.\n"
  157. IDS_REGVALUE_ZERO "ERROR: The environmental variable name cannot be empty.\n"
  158. IDS_REGVALUE_SPECIFIED "ERROR: The environmental variable name must be specified.\n"
  159. IDS_ERROR_INVALIDCOORDINATES "ERROR: Invalid Coordinates Specified.\n"
  160. IDS_NULL_REGISTRY "ERROR: Invalid syntax. Value expected for '/k'.\nType ""SETX /?"" for usage.\n"
  161. IDS_ERROR_SEARCH_STRING "ERROR: The search string cannot be empty.\n"
  162. IDS_MAX_COORDINATES "ERROR: Either the first or second coordinate should be in the range -9999999 to +9999999.\n"
  163. IDS_WARNING_LENGTH_EXCEED "\nWARNING: The length of the extracted value is truncated to 1024 characters.\n"
  164. IDS_WARNING_LENGTH_EXCEED_EX "\nWARNING: The data being saved is truncated to 1024 characters.\n"
  165. IDS_ERROR_CMDPARSER_LENGTH "ERROR: Length of the command line argument should not exceed 255 characters.\n"
  166. IDS_NULL_REGISTRY_VALUE "/K cannot be empty.\n"
  167. IDS_NULL_ABSOLUTE_VALUE "ERROR: /A cannot be empty.\n"
  168. IDS_NULL_RELATIVE_VALUE "ERROR: /R cannot be empty.\n"
  169. IDS_INVALID_ABS_NEG "ERROR: Absolute coordinates cannot be negative.\n"
  170. END
  171. STRINGTABLE DISCARDABLE
  172. BEGIN
  173. IDS_VALUE_UPDATED "\nSUCCESS: Specified value was saved.\n"
  174. IDS_VALUE_UPDATED2 "SUCCESS: Specified value was saved.\n"
  175. IDS_VALUE "\nExtracted value: %s."
  176. IDS_VALUE2 "\nExtracted value: "
  177. END
  178. STRINGTABLE DISCARDABLE
  179. BEGIN
  180. IDS_IGNORE_LOCALCREDENTIALS "\nWARNING: User credentials cannot be used for local connections.\n"
  181. END
  182. //
  183. // Version resources
  184. //
  185. #include <ntverp.h>
  186. #define VER_FILETYPE VFT_APP
  187. #define VER_FILESUBTYPE VFT2_UNKNOWN
  188. #define VER_FILEDESCRIPTION_STR "Setx - Sets environment variables"
  189. #define VER_INTERNALNAME_STR "setx.exe"
  190. #define VER_ORIGINALFILENAME_STR "setx.exe"
  191. #include <common.ver>