My computer's headphone connector is broken.
When play music the speaker has no sound, even no headphone is inserted, and speaker is the default playback device.
When play music the speaker has no sound, even no headphone is inserted, and speaker is the default playback device.
So, write this VBS script to make focus and change volume of headphone, then speaker could make sounds...
My computer's headphone connector is broken.
When play music the speaker has no sound, even no headphone is inserted, and speaker is the default playback device.
So, write this VBS script to make focus and change volume of headphone, then speaker could make sounds...
set oShell = CreateObject("WScript.Shell")
oShell.run "%SystemRoot%\System32\SndVol.exe"
WScript.Sleep 100
oShell.SendKeys"+{TAB}" ' Tab to the mute and press space
WScript.Sleep 100
oShell.SendKeys"+{TAB}" ' Tab to the mute and press space
WScript.Sleep 100
oShell.SendKeys"{DOWN}" ' Tab to the mute and press space
WScript.Sleep 100
oShell.SendKeys"{DOWN}" ' Tab to the mute and press space
WScript.Sleep 100
oShell.SendKeys"{ENTER}" ' Tab to the mute and press space
WScript.Sleep 100
oShell.SendKeys"{TAB}" ' Tab to the mute and press space
WScript.Sleep 100
oShell.SendKeys"{TAB}" ' Tab to the mute and press space
Dim counter
counter = 20
While counter > 0
oShell.AppActivate "Volume Mixer"
oShell.SendKeys"{TAB}" ' Tab to the mute and press space
WScript.Sleep 200
oShell.SendKeys"{TAB}" ' Tab to the mute and press space
oShell.SendKeys"{DOWN}" ' Tab to the mute and press space
WScript.Sleep 500
oShell.SendKeys"{UP}" ' Tab to the mute and press space
WScript.Sleep 500
counter = counter - 1
Wend
oShell.AppActivate "Volume Mixer"
oShell.SendKeys"%{F4}" ' ALT F4 to exit the app.
set oShell = nothing