2015-11-23 78 views

回答

2

您應該能夠使用Win32_SoundDevice WMI類。下面是這可能是一個很好的起點的示例腳本:

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") 
Set colItems = objWMIService.ExecQuery("Select * from Win32_SoundDevice",,48) 
For Each objItem in colItems 
    Wscript.Echo "Availability: " & objItem.Availability 
    Wscript.Echo "Caption: " & objItem.Caption 
    Wscript.Echo "Description: " & objItem.Description 
    Wscript.Echo "Name: " & objItem.Name 
    Wscript.Echo "Status: " & objItem.Status 
    Wscript.Echo "StatusInfo: " & objItem.StatusInfo 
Next 

source

我會做一些比較運行前插入耳機後,從那裏走。

相關問題