J'essaie de write a batch file on Windows 10 that allows me to switch between my headset and my speakers as default audio device when I run it. Je ne veux pas to use any third-party software.
J'ai essayé searching around but i only found old scripts that don't seem to work and also refer to a `HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\Volume Control\` path that doesn't seem to exist anymore.
I cant't find any information on the Windows 10 register about this, also I'm not comfortable with fiddling too much with the register if Je ne suis pas sûr of what i'm doing.
Switching par défaut audio périphérique avec a batch fichier
Re: Switching par défaut audio périphérique avec a batch fichier
I appreciate you don't wish to use any third party software, but as an option for si vous ne mind using a ~100kb exe, vous pouvez utiliser [Nircmd](http://www.nirsoft.net/utils/nircmd.html) with the commands:
```
nircmd setdefaultsounddevice "Speakers" 1
```
or
```
nircmd setdefaultsounddevice "Headphones" 1
```
Vous devez assurez-vous you use the exact name of your audio devices as listed under `Playback Devices` (clic droit the sound control in the zone de notification). It may be easier to rename them under `Properties` to simpler names, especially if the names clash in any way.
The `1` at the end of the command signifies "Default Device". Using `2` signifies "Default Communications Device".
If you really don't want to use a third party tool, here's a diff of a registry key that seems to change when I change my default sound device, it may be of some use to you, but Je ne sais pas exactly what it's doing. It's not as simple as a 1 or a 0 to indicate if it's a default, it would seem.
```
nircmd setdefaultsounddevice "Speakers" 1
```
or
```
nircmd setdefaultsounddevice "Headphones" 1
```
Vous devez assurez-vous you use the exact name of your audio devices as listed under `Playback Devices` (clic droit the sound control in the zone de notification). It may be easier to rename them under `Properties` to simpler names, especially if the names clash in any way.
The `1` at the end of the command signifies "Default Device". Using `2` signifies "Default Communications Device".
If you really don't want to use a third party tool, here's a diff of a registry key that seems to change when I change my default sound device, it may be of some use to you, but Je ne sais pas exactly what it's doing. It's not as simple as a 1 or a 0 to indicate if it's a default, it would seem.