Guest User

test menu

a guest
Sep 20th, 2012
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '-----------------------------------------------------------------
  2. ' Name: Menu Template Script
  3. ' By: Harvey Colwell
  4. ' CopyRight: (c) Jul 2000, All Rights Reserved!
  5. '
  6. '*****************************************************************
  7. Option Explicit
  8.  
  9. Dim oFS, oWS, oWN
  10.  
  11. Set oWS = WScript.CreateObject("WScript.Shell")
  12. Set oWN = WScript.CreateObject("WScript.Network")
  13. Set oFS = WScript.CreateObject("Scripting.FileSystemObject")
  14.  
  15. '----------
  16. ' Script SetUp
  17. '----------
  18.  
  19. '----------
  20. ' Main
  21. '----------
  22. Select Case InputBox ( _
  23. "Enter menu item number then Click Ok. . ." & vbCrlf & vbCrlf & _
  24. " [1] Item 1" & vbCrlf & _
  25. " [2] Item 2" & vbCrlf & _
  26. " [3] Item 3" & vbCrlf & _
  27. " [4] Item 4", _
  28. "Main Menu")
  29.  
  30. Case "1"
  31. Call sub1()
  32. Case "2"
  33. Call sub2()
  34. Case "3"
  35. Call sub3()
  36. Case "4"
  37. Call sub4()
  38. Case Else
  39. WScript.Echo "You entered an invalid menu choice!"
  40.  
  41. End Select
  42.  
  43. '----------
  44. ' Clean Up
  45. '----------
  46.  
  47. Call CleanUp
  48.  
  49. '-----------------------------------------------------------------
  50. ' Subroutines
  51. '*****************************************************************
  52.  
  53. '---------------------
  54. Sub CleanUp()
  55. Set oWS = Nothing
  56. Set oWN = Nothing
  57. Set oFS = Nothing
  58. WScript.Quit
  59. End Sub
  60.  
  61. '---------------------
  62. Sub sub1()
  63. WScript.Echo "You selected Menu Item 1"
  64. End Sub
  65.  
  66. '---------------------
  67. Sub sub2()
  68. WScript.Echo "You selected Menu Item 2"
  69. End Sub
  70.  
  71. '---------------------
  72. Sub sub3()
  73. WScript.Echo "You selected Menu Item 3"
  74. End Sub
  75.  
  76. '---------------------
  77. Sub sub4()
  78. WScript.Echo "You selected Menu Item 4"
  79. End Sub
  80.  
  81. '-----------------------------------------------------------------
  82. ' Functions
  83. '*****************************************************************
  84. '---------------------
  85.  
  86. '***************************************
Advertisement
Add Comment
Please, Sign In to add comment