@echo off
set _toggle=0
:Start
CLS
echo 1.Switch
CHOICE /C 1 /M "Enter your choice:"
IF ERRORLEVEL 1 call:Switch
:Switch
if "%_toggle%"=="0" (goto Speakers
) else (goto Headset)
:Speakers
echo Speakers Active
nircmd.exe setdefaultsounddevice "Speakers"
set /a _toggle=%_toggle%+1
timeout /t 1 /nobreak
goto Start
:Headset
echo Headset Active
nircmd.exe setdefaultsounddevice "Headset"
set /a _toggle=%_toggle%-1
timeout /t 1 /nobreak
goto Start
Based of Forest bat and implemented with the choice bat option I found also on stack overflow, this should work like a charm, i use it to toggle the desktop icons visibility.