@echo off
 
REM This script is generated the serial number and device UUID of device and writes it to the specific csv file.
REM Usage: AbtDumpDevInfo.bat [Path]\<filename.csv>
REM	Example:
REM		C:\>AbtDumpDevInfo.bat C:\Refurb\SerialAndDeviceUUID.csv
REM		C:\>AbtDumpDevInfo.bat \\Public\Refurb\SerialAndDeviceUUID.csv
 
 
REM Get device UUID
set "uuid="
for /f "skip=1delims=" %%a in (
'wmic csproduct get UUID'
) do if not defined uuid set "uuid=%%a"
set uuid=%uuid: =%
 
REM Get device serial
set "sn1="
for /f "skip=1delims=" %%a in (
'wmic bios get serialnumber'
) do if not defined sn1 set "sn1=%%a"
set sn1=%sn1: =%
 
REM Write serial number and device UUID to file.
echo %sn1%,%uuid% >> %1