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.

98 lines
5.9 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_INCORRECT_SYNTAX "Invalid syntax.\nType ""CHOICE /?"" for usage.\n"
  12. IDS_TYPE_HELP "Type ""CHOICE /?"" for usage.\n"
  13. IDS_D_WITHOUT_T "Invalid syntax. /D can only be specified when /T is specified.\nType ""CHOICE /?"" for usage.\n"
  14. IDS_T_INVALID_VALUE "Invalid syntax. Valid range for /T is %d - %d.\nType ""CHOICE /?"" for usage.\n"
  15. IDS_D_BIG "Invalid syntax. /D only accepts single character.\nType ""CHOICE /?"" for usage.\n"
  16. IDS_D_NOT_MATCHED_TO_C "Invalid syntax. Default choice is not found in the specified choices.\nType ""CHOICE /?"" for usage.\n"
  17. IDS_C_EMPTY "List of choices cannot be empty.\n"
  18. IDS_D_MISSING "Invalid syntax. /T can be specified only when /D is specified.\nType ""CHOICE /?"" for usage.\n"
  19. IDS_DUPLICATE_CHOICE "Duplicate choices are not allowed.\n"
  20. IDS_CHOICE_INVALID "Invalid choice. The valid choice characters are: a-z, A-Z, 0-9 and ASCII values of 128 to 254.\n"
  21. IDS_MESSAGE_OVERFLOW "Message cannot be more than 254 characters.\n"
  22. IDS_TWO_BYTES_NOTALLOWED "The specified choices are not acceptable.\n"
  23. IDS_TFACTOR_NULL_STIRNG "The timeout factor cannot be empty.\n"
  24. IDS_INVALID_TIMEOUT_FACTOR "The timeout factor is invalid.\n"
  25. IDS_FILE_EMPTY "\nERROR: The file is either empty or does not contain the valid choices.\n"
  26. IDS_DEFAULT_CHOICE "YN"
  27. IDS_ERR_CHARUPPER "The characters cannot be converted to upper case.\n"
  28. IDS_DEFAULT_EMPTY "The default choice cannot be empty.\n"
  29. END
  30. STRINGTABLE DISCARDABLE
  31. BEGIN
  32. IDS_HELP1 "\nCHOICE [/C choices] [/N] [/CS] [/T timeout /D choice] [/M text]\n\n"
  33. IDS_HELP2 "Description:\n"
  34. IDS_HELP3 " This tool allows users to select one item from a list \n"
  35. IDS_HELP4 " of choices and returns the index of the selected choice.\n\n"
  36. IDS_HELP5 ""
  37. IDS_HELP7 "Parameter List:\n"
  38. IDS_HELP8 " /C choices Specifies the list of choices to be created.\n"
  39. IDS_HELP9 " Default list is ""YN"".\n\n"
  40. IDS_HELP10 ""
  41. IDS_HELP11 " /N Hides the list of choices in the prompt.\n"
  42. IDS_HELP12 " The message before the prompt is displayed\n"
  43. IDS_HELP13 " and the choices are still enabled.\n\n"
  44. IDS_HELP14 ""
  45. IDS_HELP15 " /CS Enables case-sensitive choices to be selected.\n"
  46. IDS_HELP16 " By default, the utility is case-insensitive.\n\n"
  47. IDS_HELP17 ""
  48. IDS_HELP18 " /T timeout The number of seconds to pause before a default \n"
  49. IDS_HELP19 " choice is made. Acceptable values are from 0 to \n"
  50. IDS_HELP20 " 9999. If 0 is specified, there will be no pause \n"
  51. IDS_HELP21 " and the default choice is selected.\n\n"
  52. IDS_HELP22 ""
  53. IDS_HELP23 " /D choice Specifies the default choice after nnnn seconds.\n"
  54. IDS_HELP24 " Character must be in the set of choices specified\n"
  55. IDS_HELP25 " by /C option and must also specify nnnn with /T.\n\n"
  56. IDS_HELP26 ""
  57. IDS_HELP27 " /M text Specifies the message to be displayed before \n"
  58. IDS_HELP28 " the prompt. If not specified, the utility \n"
  59. IDS_HELP29 " displays only a prompt.\n\n"
  60. IDS_HELP30 ""
  61. IDS_HELP31 " /? Displays this help message.\n\n"
  62. IDS_HELP32 " NOTE:\n"
  63. IDS_HELP33 " The ERRORLEVEL environment variable is set to the index of the\n"
  64. IDS_HELP34 " key that was selected from the set of choices. The first choice\n"
  65. IDS_HELP35 " listed returns a value of 1, the second a value of 2, and so on.\n"
  66. IDS_HELP36 " If the user presses a key that is not a valid choice, the tool \n"
  67. IDS_HELP37 " sounds a warning beep. If tool detects an error condition,\n"
  68. IDS_HELP38 " it returns an ERRORLEVEL value of 255. If the user presses \n"
  69. IDS_HELP39 " CTRL+BREAK or CTRL+C, the tool returns an ERRORLEVEL value\n"
  70. IDS_HELP40 " of 0. When you use ERRORLEVEL parameters in a batch program, list\n"
  71. IDS_HELP41 " them in decreasing order.\n\n"
  72. IDS_HELP42 ""
  73. IDS_HELP43 "Examples:\n"
  74. IDS_HELP44 " CHOICE /?\n"
  75. IDS_HELP45 " CHOICE /C YNC /M ""Press Y for Yes, N for No or C for Cancel.""\n"
  76. IDS_HELP46 " CHOICE /T 10 /C ync /CS /D y \n"
  77. IDS_HELP47 " CHOICE /C ab /M ""Select a for option 1 and b for option 2.""\n"
  78. IDS_HELP48 ""
  79. IDS_HELP_END " CHOICE /C ab /N /M ""Select a for option 1 and b for option 2.""\n"
  80. END
  81. //
  82. // Version resources
  83. //
  84. #include <ntverp.h>
  85. #define VER_FILETYPE VFT_APP
  86. #define VER_FILESUBTYPE VFT2_UNKNOWN
  87. #define VER_FILEDESCRIPTION_STR "Offers the user a choice"
  88. #define VER_INTERNALNAME_STR "choice.exe"
  89. #define VER_ORIGINALFILENAME_STR "choice.exe"
  90. #include <common.ver>