Advertisement
MrPolywhirl

run.bat

Oct 17th, 2013
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2. cls
  3.  
  4. set PRGM=Foo
  5. set INPUT_FILE=input.txt
  6. set OUTPUT_FILE=output.txt
  7. set VALUES=(7 4 5)
  8.  
  9. call :log "Generating..."
  10. call :generateInput
  11.  
  12. call :log "Compiling..."
  13. javac %PRGM%.java
  14.  
  15. call :log "Executing..."
  16. java %PRGM%
  17.  
  18. call :log "Results..."
  19. type %OUTPUT_FILE%
  20.  
  21. call :log "Done..."
  22.  
  23. goto Exit
  24.  
  25. :: ----------------------------------------------------------
  26. :: Functions
  27. :: ----------------------------------------------------------
  28.  
  29. :printDate
  30. for /f "tokens=2-4 delims=/ " %%a in ('echo %DATE%') do (set mydate=%%c/%%a/%%b)
  31. for /f "tokens=1-3 delims=/:./ " %%a in ('echo %TIME%') do (set mytime=%%a:%%b:%%c)
  32. echo|set /p=[%mydate% %mytime%]
  33. goto:EOF
  34.  
  35. :log
  36. call :printDate
  37. echo %~1
  38. goto:EOF
  39.  
  40. :generateInput
  41. if exist %INPUT_FILE% del /F %INPUT_FILE%
  42. for %%x in %VALUES% do echo %%x>> %INPUT_FILE%
  43. goto:EOF
  44.  
  45. :Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement