Advertisement
npocmaka

DatePart.bat

Nov 5th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.46 KB | None | 0 0
  1. @echo off
  2. rem gets Date Parts
  3. rem by Vasil "npocmaka" Arnaudov
  4. for /f "skip=10 tokens=2,3,4,5,6,7,8 delims=:    " %%D in ('robocopy /l * %tmp% %tmp% /ns /nc /ndl /nfl /np /njh /XF * /XD * ') do (
  5.  set "dow=%%D"
  6.  set "month=%%E"
  7.  set "day=%%F"
  8.  set "HH=%%G"
  9.  set "MM=%%H"
  10.  set "SS=%%I"
  11.  set "year=%%J"
  12. )
  13.  
  14. echo Day of the week: %dow%
  15. echo Day of the month : %day%
  16. echo Month : %month%
  17. echo hour : %HH%
  18. echo minutes : %MM%
  19. echo seconds : %SS%
  20. echo year : %year%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement