@ECHO Off
SETLOCAL ENABLEEXTENSIONS
IF %1.==. ECHO Missing drive letter&GOTO :EOF

FOR /F "tokens=10,11,12,13,14,15,16,17 delims=- " %%A IN ('secinspect -dsec \\.\%1 0 1 ^| FIND "0x0040"') DO (
FOR %%? IN (%%H %%G %%F %%E %%D %%C %%B %%A) DO CALL :do_hex 0x%%?
)

::VOL %1
SET UUID_NTFS=%Serial%
::ECHO %UUID_NTFS%  %FAT_UUID%
endlocal & set UUID_NTFS=%UUID_NTFS%
@echo off
GOTO :EOF

:do_hex
SET /A dec=%1
CMD /C EXIT /B %dec%
SET "Serial=%Serial%%=ExitCode:~-2%"
GOTO :EOF