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

FOR /F "tokens=5,6,7,8 delims=- " %%A IN ('secinspect -dsec \\.\%1 0 1 ^| FIND "0x0040"') DO (
FOR %%? IN (%%D %%C) DO CALL :do_hex 0x%%?
FOR %%? IN (%%B %%A) DO CALL :do_hex1 0x%%?
)

SET UUID_FAT32=%Serial%-%Serial1%
endlocal & set UUID_FAT32=%UUID_FAT32%
GOTO :EOF

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

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