@ECHO OFF WMIC OS GET CAPTION |Find "Microsoft Windows Server" > Nul IF %ERRORLEVEL% == 0 GOTO WINSERVERS WMIC OS GET CAPTION |Find "Microsoft Windows 10" > Nul IF %ERRORLEVEL% == 0 GOTO WIN10PCS WMIC OS GET CAPTION |Find "Microsoft Windows 11" > Nul IF %ERRORLEVEL% == 0 GOTO WIN11PCS GOTO END :WINSERVERS ECHO This device running Windows Server. GOTO END :WIN10PCS ECHO This device running Windows 10. GOTO END :WIN11PCS ECHO This device running Windows 11. GOTO END :END ECHO END