Advertisement
MCJames

Example of "Yes or No Selection"

Mar 19th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.04 KB | None | 0 0
  1. ::程式介面設定
  2. @echo off
  3. @SETLOCAL ENABLEEXTENSIONS
  4. @COLOR 17
  5. TITLE Yes Or No Selection
  6. cls
  7.  
  8.  
  9. :Start
  10. ::啟動程式所顯示的畫面
  11. cls
  12. echo If you still can see this file after the program closed, the reason is the program wrongly shut down. > ProgramRunning.txt
  13. Echo ==============================================================================
  14. Echo.
  15. Echo           Example of ▓  ▓         ▓  ▓
  16. Echo                      ▓  ▓         ▓▓ ▓
  17. Echo                      ▓▓▓▓ ▓▓▓ ▓▓▓ ▓ ▓▓
  18. Echo                         ▓ ▓ ▓ ▓   ▓  ▓
  19. Echo                      ▓▓▓▓ ▓▓▓ ▓   ▓  ▓ Selection
  20. Echo.
  21. Echo ==============================================================================
  22. Echo.
  23. Echo   Example of "Yes or No Selection"
  24. Echo   Copyright (c) James Studio 2015
  25. Echo.
  26. Echo ------------------------------------------------------------------------------
  27. Echo.
  28. Echo   This is an example of "Yes or No Selection". In the next screen, select the
  29. Echo   "Y" will quit the program, select "N" will reappear the screen.
  30. Echo.
  31. Echo ------------------------------------------------------------------------------
  32. Echo.
  33. PAUSE
  34. Echo.
  35. Echo ------------------------------------------------------------------------------
  36. cls
  37. Goto Menu
  38.  
  39.  
  40. :Menu
  41. ::詢問用家是否要關閉程式
  42. cls
  43. set Confirmation=
  44. Echo ==============================================================================
  45. Echo.
  46. Echo           Example of ▓  ▓         ▓  ▓
  47. Echo                      ▓  ▓         ▓▓ ▓
  48. Echo                      ▓▓▓▓ ▓▓▓ ▓▓▓ ▓ ▓▓
  49. Echo                         ▓ ▓ ▓ ▓   ▓  ▓
  50. Echo                      ▓▓▓▓ ▓▓▓ ▓   ▓  ▓ Selection
  51. Echo.
  52. Echo ==============================================================================
  53. Echo.
  54. Echo   Example of "Yes or No Selection"
  55. Echo.
  56. Echo ------------------------------------------------------------------------------
  57. ::模板開始
  58. Echo.
  59. Echo   Exit Confirmation:
  60. Echo     [Y]es
  61. Echo     [N]o
  62. Echo   *Please enter the first letter of the item you want to select.
  63. Echo.
  64. Echo ------------------------------------------------------------------------------
  65. Echo.
  66.  ::將選擇的字母寫入「Confirmation」
  67. set /P Confirmation=  Please select an item: %=%
  68. Echo.
  69. Echo ------------------------------------------------------------------------------
  70.  ::選擇「Y」會退出程式,選擇「N」會重新選擇
  71. If %Confirmation% == Y goto Exit
  72. If %Confirmation% == N goto SelectNo
  73. If %Confirmation% == y goto Exit
  74. If %Confirmation% == n goto SelectNo
  75.  ::選擇錯誤會回到開始畫面
  76. goto Start
  77. ::模板結束
  78.  
  79.  
  80. :SelectNo
  81. ::選擇否所跳轉的畫面
  82. cls
  83. Echo ==============================================================================
  84. Echo.
  85. Echo           Example of ▓  ▓         ▓  ▓
  86. Echo                      ▓  ▓         ▓▓ ▓
  87. Echo                      ▓▓▓▓ ▓▓▓ ▓▓▓ ▓ ▓▓
  88. Echo                         ▓ ▓ ▓ ▓   ▓  ▓
  89. Echo                      ▓▓▓▓ ▓▓▓ ▓   ▓  ▓ Selection
  90. Echo.
  91. Echo ==============================================================================
  92. Echo.
  93. Echo   Example of "Yes or No Selection"
  94. Echo.
  95. Echo ------------------------------------------------------------------------------
  96. Echo.
  97. Echo   You have chosen "No". Will return to the original screen.
  98. Echo.
  99. Echo ------------------------------------------------------------------------------
  100. Echo.
  101. PAUSE
  102. Echo.
  103. Echo ------------------------------------------------------------------------------
  104. goto Menu
  105.  
  106.  
  107. :Exit
  108. ::關閉程式
  109. cls
  110. Echo ==============================================================================
  111. Echo.
  112. Echo           Example of ▓  ▓         ▓  ▓
  113. Echo                      ▓  ▓         ▓▓ ▓
  114. Echo                      ▓▓▓▓ ▓▓▓ ▓▓▓ ▓ ▓▓
  115. Echo                         ▓ ▓ ▓ ▓   ▓  ▓
  116. Echo                      ▓▓▓▓ ▓▓▓ ▓   ▓  ▓ Selection
  117. Echo.
  118. Echo ==============================================================================
  119. Echo.
  120. Echo   Example of "Yes or No Selection"
  121. Echo.
  122. Echo ------------------------------------------------------------------------------
  123. Echo.
  124. Echo   Thank you for using our application, goodbye!
  125. Echo   The program has been closed.
  126. Echo.
  127. Echo ------------------------------------------------------------------------------
  128. Echo.
  129. PAUSE
  130. Echo.
  131. Echo ------------------------------------------------------------------------------
  132. cls
  133. del ProgramRunning.txt
  134. @COLOR 07
  135. Exit /B
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement