Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 36188

PowerTip: Use PowerShell to play WAV files

$
0
0

Summary: Make use of the native features of Windows through PowerShell to play sound.

   Hey, Scripting Guy! I’ve got some WAV files I would love to play without launching an application. Is there a way in Windows PowerShell to do this?

     You sure can! Using the System.Media.Soundplayer object, you can do this quite easily. Here is an example of how to do this:

$PlayWav=New-Object System.Media.SoundPlayer

$PlayWav.SoundLocation=’C:FooSoundfile.wav’

$PlayWav.playsync()

Drawing of Dr. Scripto

 


Viewing all articles
Browse latest Browse all 36188

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>