Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- rem -- printing local time with w32tm
- rem -- by Vasil "npocmaka" Arnaudov
- setlocal
- for /f "tokens=3,4 delims=^( " %%T in ('w32tm /stripchart /computer:localhost /samples:1 /packetinfo /period:1 ^| find "Transmit Timestamp:"') do (
- set HEXx64_Time_Stamp=%%T
- set ANSI_Current_Date=%%U
- )
- call :hexByteRevert %HEXx64_Time_Stamp% test_x46
- w32tm /ntpte %test_x46%
- goto :eof
- :hexByteRevert [%1 - hex value , %2 - variable to store result in]
- setlocal ENABLEDELAYEDEXPANSION
- set hex=%~1
- set res=%~2
- set "temp="
- for /L %%L in (2,2,16) do (
- set temp=!hex:~%%L,2!!temp!
- )
- endlocal & call set %res%=0x%temp%
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement