Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for random.bat

(view source code of random.bat as plain text)

  1. @ECHO OFF
  2. ECHO.
  3. IF NOT [%1]==[] GOTO Syntax
  4. VER | FIND "Windows 2000" >NUL
  5. IF NOT ERRORLEVEL 1 GOTO Start
  6. VER | FIND "Windows XP" >NUL
  7. IF NOT ERRORLEVEL 1 GOTO Start
  8. GOTO Syntax
  9.  
  10. :Start
  11. SET NAT=%Random%
  12. IF [%NAT%]==[] GOTO Syntax
  13. IF %NAT% GTR 9 SET /A NAT = 1%NAT:~-2,2% - 100
  14. SET NAT
  15. GOTO End
  16.  
  17. :Syntax
  18. ECHO Random.bat, Version 2.00 for Windows 2000 / XP
  19. ECHO Generate a semi-random number between 0 and 99.
  20. ECHO.
  21. ECHO Written by Nathan Rooke
  22. ECHO Modified by Rob van der Woude
  23. ECHO.
  24. ECHO Usage:  RANDOM
  25.  
  26. :End
  27.  

page last modified: 2024-04-16; loaded in 0.0074 seconds