@echo off FOR /F " usebackq tokens=2,* delims=x" %%A IN (`REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\IDConfigDB /v CurrentConfig`) DO set profilenumber=%%A echo active profile number is: %profilenumber% pause