Are they still doing that? I would have thought that people would have realized what a horrible, horrible idea this was by now and rolled it back. Amazing.
Get-Service -Name Audiosrv | Stop-Service -Force
Windows is quite scriptable, it is just a matter of knowning the right knobs.
https://blogs.technet.microsoft.com/heyscriptingguy/2013/03/...
There is a registry setting that sets the control panel to no sound but it has no practical effect. The only suggestion I found that works is to delete the wav files, but that's kind of messy
This is a discussion for Developers who want to automate... manually clicking stuff is not that answer.
We are discussing about automating changing the default settings of windows. Not of how to change them manually through the UI.
The more inexplicable thing is why the modern/metro/universal/whatever-it-is-this-week apps don't show up in the volume mixer at all, and you have to rely on third-part tools like EarTrumpet to tweak them when they are being obnoxious.
You can do this with a .reg file.
Just need to set everything in:
HKCU/AppEvents/Schemes/Apps/.Default/[Sound Name]/.Current/(Default) to null.
Easiest way is just to set "No Sound" on an example user, then Export the entire .Default tree, you can then re-import the .reg file into a different user and have no sound on there too.
Which doesn't take effect until after a reboot. I think OP was wanting a scripted way to disable sound at runtime.
As to if it requires a logout: In my experience, no, but there may be edge cases (e.g. non-OS software is also in the sound scheme, like Visual Studio and Skype for Business).
If people want to investigate further, spin up Process Monitor, and set the filter to only display rundll32.exe then set sound profiles in the Sound Control Panel applet (mmsys.cpl).