Advertisement
UrbanTwitch

Batch File Userinput

Apr 14th, 2011
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. @echo off
  2. :type
  3. echo.
  4. set /P myname="Type your name: "
  5. echo.
  6. echo So your name is: %myname%?
  7. set /P isit="(y/n:) "
  8. echo.
  9. echo You responded: %isit%
  10.  
  11. IF %isit%==y OR %isit%==Y OR %isit%==yes OR %isit%==Yes (
  12. GOTO :saidyes
  13. ) ELSE (
  14. GOTO :saidno
  15. )
  16.  
  17. :saidyes
  18. echo.
  19. echo Hooray! Hey, %myname%!
  20. GOTO :END
  21.  
  22. :saidno
  23. echo.
  24. echo OK, lets try again.
  25. BREAK
  26. GOTO :type
  27.  
  28. :END
  29. PAUSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement