Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change Default Windows Sound With Powershell

I would like to find a way to change the windows default sound with powershell.

In vbs it is written like this:

WshShell.RegWrite "HKCU\AppEvents\Schemes\Apps\.Default\.Default\.Current\","c:\windows\media\horn.wav","REG_SZ"

I tried invoking the command but did not know the correct way to do it.

like image 273
Cyber Block Avatar asked May 23 '26 09:05

Cyber Block


1 Answers

Powershell does not have a native cmdlets for that, beside you would have to use C# to get that functionality in powershell.

Luckily, someone did the hardwork and put that in to a module, check the following repo : https://github.com/frgnca/AudioDeviceCmdlets

There are detailed instructions on how to install the module, once you done that you can see all devices

Get-AudioDevice -List


Index   : 1
Default : True
Type    : Playback
Name    : Speakers (2- Jabra EVOLVE LINK)
ID      : {0.0.0.00000000}.{8c58263c-e6a0-4c7b-8e51-5231f04cbcb9}
Device  : CoreAudioApi.MMDevice

From there you can see the current Default device and change it however you like.

like image 55
Vasil Nikolov Avatar answered May 25 '26 09:05

Vasil Nikolov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!