PageRenderTime 18ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Lib/test/check_soundcard.vbs

http://unladen-swallow.googlecode.com/
Visual Basic | 13 lines | 12 code | 1 blank | 0 comment | 4 complexity | 4001df4ebd9c87400d1b58f4225c473f MD5 | raw file
 1rem Check for a working sound-card - exit with 0 if OK, 1 otherwise.
 2set wmi = GetObject("winmgmts:")
 3set scs = wmi.InstancesOf("win32_sounddevice")
 4for each sc in scs
 5   set status = sc.Properties_("Status")
 6   wscript.Echo(sc.Properties_("Name") + "/" + status)
 7   if status = "OK" then
 8       wscript.Quit 0 rem normal exit
 9   end if
10next
11rem No sound card found - exit with status code of 1
12wscript.Quit 1
13