Advertisement
Guest User

Untitled

a guest
Sep 24th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. @ECHO off
  2.  
  3. MODE CON:COLS=46 LINES=9
  4.  
  5. echo --------------------------------- >> C:UsersusernameDesktopProgress.txt
  6.  
  7. echo. >> C:UsersusernameDesktopProgress.txt
  8.  
  9. echo %date% >> C:UsersusernameDesktopProgress.txt
  10.  
  11. set counter=0
  12.  
  13. set TST=0
  14.  
  15. :1
  16.  
  17. @echo off
  18.  
  19. setlocal
  20.  
  21. rem The format of %TIME% is HH:MM:SS,CS for example 23:59:59,99
  22. set STARTTIME=%TIME%
  23.  
  24. @echo off
  25.  
  26. set /a counter=counter+1
  27.  
  28. set /a TST=TST+%duration%
  29.  
  30. rem now break the centiseconds down to hors, minutes, seconds and the remaining centiseconds
  31. set /A TSTH=%TST% / 360000
  32. set /A TSTM=(%TST% - %TSTH%*360000) / 6000
  33. set /A TSTS=(%TST% - %TSTH%*360000 - %TSTM%*6000) / 100
  34. set /A TSTHS=(%TST% - %TSTH%*360000 - %TSTM%*6000 - %TSTS%*100)
  35.  
  36. rem some formatting
  37. if %TSTH% LSS 10 set TSTH=0%TSTH%
  38. if %TSTM% LSS 10 set TSTM=0%TSTM%
  39. if %TSTS% LSS 10 set TSTS=0%TSTS%
  40. if %TSTHS% LSS 10 set TSTHS=0%TSTHS%
  41.  
  42. echo. >> C:UsersusernameDesktopProgress.txt
  43.  
  44. echo Total Time: %TSTH%:%TSTM%:%TSTS% Plus >> C:UsersusernameDesktopProgress.txt
  45. echo Started on: %time% >> C:UsersusernameDesktopProgress.txt
  46.  
  47.  
  48. color f0
  49.  
  50. cls
  51.  
  52. :hour
  53.  
  54. set hour=1
  55.  
  56. :min
  57.  
  58. set min=0
  59.  
  60. :second
  61.  
  62. set second=0
  63.  
  64. :countit
  65.  
  66. cls
  67.  
  68. echo Main Event
  69. echo %date%
  70. echo.
  71. echo %min% Minutes
  72. echo %sec% Seconds
  73. echo Hours # %counter%
  74. echo Total Time: %TSTH%:%TSTM%:%TSTS%
  75.  
  76. set /a sec="%sec%-1"
  77.  
  78. if %sec%==-1 set /a min="%min%-1"
  79. if %sec%==-1 set /a sec="59"
  80. if %min%==-1 set /a hour="%hour%-1"
  81. if %min%==-1 set /a min="59"
  82. if %hour%==-1 goto 2
  83.  
  84. ping -n 2 127.0.0.1 >NUL
  85.  
  86. goto countit
  87.  
  88. :2
  89.  
  90. start "" "C:UsersusernameDesktopTimer file1.mp3"
  91.  
  92. echo.
  93.  
  94. pause>nul
  95.  
  96. echo Are You Sure?
  97.  
  98. pause>nul
  99.  
  100. cls
  101.  
  102. echo Okay then, Ready..
  103.  
  104. Pause>nul
  105.  
  106. @echo off
  107.  
  108. echo stopped on: %time% >> C:UsersusernameDesktopProgress.txt
  109.  
  110. set ENDTIME=%TIME%
  111.  
  112. rem output as time
  113. echo STARTTIME: %STARTTIME%
  114. echo ENDTIME: %ENDTIME%
  115.  
  116. rem convert STARTTIME and ENDTIME to centiseconds
  117. set /A STARTTIME=(1%STARTTIME:~0,2%-100)*360000 + (1%STARTTIME:~3,2%-100)*6000 + (1%STARTTIME:~6,2%-100)*100 + (1%STARTTIME:~9,2%-100)
  118.  
  119. set /A ENDTIME=(1%ENDTIME:~0,2%-100)*360000 + (1%ENDTIME:~3,2%-100)*6000 + (1%ENDTIME:~6,2%-100)*100 + (1%ENDTIME:~9,2%-100)
  120.  
  121. rem calculating the duratyion is easy
  122. set /A DURATION=%ENDTIME%-%STARTTIME%
  123.  
  124. rem now break the centiseconds down to hors, minutes, seconds and the remaining centiseconds
  125. set /A DURATIONH=%DURATION% / 360000
  126. set /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
  127. set /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
  128. set /A DURATIONHS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000 - %DURATIONS%*100)
  129.  
  130. rem some formatting
  131. if %DURATIONH% LSS 10 set DURATIONH=0%DURATIONH%
  132. if %DURATIONM% LSS 10 set DURATIONM=0%DURATIONM%
  133. if %DURATIONS% LSS 10 set DURATIONS=0%DURATIONS%
  134. if %DURATIONHS% LSS 10 set DURATIONHS=0%DURATIONHS%
  135.  
  136. rem outputing
  137. echo Duration is %DURATIONH%:%DURATIONM%:%DURATIONS% >> C:UsersusernameDesktopProgress.txt
  138.  
  139. cls
  140.  
  141. :4
  142.  
  143. color e0
  144.  
  145. cls
  146.  
  147. :hour
  148.  
  149. set hour=0
  150.  
  151. :min
  152.  
  153. set min=10
  154.  
  155. :sec
  156.  
  157. set sec=0
  158.  
  159. :continue
  160.  
  161. cls
  162.  
  163. echo Break...
  164. echo %date%
  165. echo.
  166. echo %min% Minutes
  167. echo %sec% Seconds
  168. echo Hours # %counter%
  169. echo Total Time: %TSTH%:%TSTM%:%TSTS%
  170.  
  171. set /a sec="%sec%-1"
  172.  
  173. if %sec%==-1 set /a min="%min%-1"
  174. if %sec%==-1 set /a sec="59"
  175. if %min%==-1 set /a hour="%hour%-1"
  176. if %min%==-1 set /a min="59"
  177. if %hour%==-1 goto 3
  178.  
  179. ping -n 2 127.0.0.1 >NUL
  180.  
  181. goto continue
  182.  
  183. :3
  184.  
  185. start "" "C:UsersusernameDesktopTimer file2.mp3"
  186.  
  187. echo.
  188.  
  189. pause>nul
  190.  
  191. echo Are You Sure?
  192.  
  193. pause>nul
  194.  
  195. cls
  196.  
  197. echo Okay then, Ready..
  198.  
  199. Pause>nul
  200.  
  201. cls
  202.  
  203. goto 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement