Play a WAV sound from PowerShell with Media.SoundPlayer

Use .NET's SoundPlayer to play Windows' own notification WAVs — or your own — from any script, synchronously or in the background.

WindowsmediasoundpowershellLow risk
Run `(New-Object Media.SoundPlayer 'C:\Windows\Media\Windows Notify.wav').PlaySync()` to play a system sound before the script continues.

01Command

Command
$ (New-Object Media.SoundPlayer 'C:\Windows\Media\Windows Notify.wav').PlaySync()

02What it does

SoundPlayer only handles WAV files, which is fine because C:\Windows\Media contains dozens of classic system sounds. PlaySync() blocks until the sound finishes — right for step-by-step alerts — while Play() plays asynchronously and won't pause your script (but a script exit can cut it off; add Start-Sleep to let it finish). With LoadAsync() plus PlayLooping() you can hold a looping sound, and the same class accepts UNC or HTTP-served WAV paths.

03Risk

RiskLow risk
RequirementsWorks with WAV files only; C:\Windows\Media ships dozens of system sounds you can use.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • SoundPlayer Class | Microsoft Learn
    Microsoft · vendor-doc · 2026-09-17
    Evidence: Microsoft documents System.Media.SoundPlayer with Play/PlaySync methods for loading and playing WAV files.

Last verified: 2026-09-17 · Category: Media

06Related solutions