This is not my code (see above source); I just made it X-Fi compliant.
Code: Select all
' ================== 1st script ====================
'----- Start Of "Headpones.vbs" ----- (Save as Headphones.vbs) ---------------------
Option Explicit
Dim WshShell
Set WshShell = CreateObject("WScript.Shell" )
' Start up the Audio Console
WshShell.CurrentDirectory = "C:\Program Files (x86)\Creative\AudioCS\"
WshShell.Run "CTAudCS.exe"
' lets open the console
While WshShell.AppActivate("Audio Control Panel") = FALSE
wscript.sleep 200
WshShell.AppActivate "Audio Control Panel"
Wend
'
' send some keystrokes to get the speaker settings box activated
'
'
WshShell.SendKeys("{TAB}{TAB}{TAB}{RIGHT}{TAB}{TAB}" )
'
' set the speaker selection to Headphones
'
WshShell.SendKeys("{h}" )
'
' exit Audio Control Panel -panel
'
WshShell.SendKeys("{TAB}{TAB}{ENTER}" )
WScript.Quit(0)
'----- End Of "Headphones.vbs" -------------------------------------------------------------
Code: Select all
' ================== 2nd script ====================
'----- Start Of "2.1.vbs" ----- (Save as 2.1.vbs) -------------------------------------------
Option Explicit
Dim WshShell
Set WshShell = CreateObject("WScript.Shell" )
' Start up the Audio Console
WshShell.CurrentDirectory = "C:\Program Files (x86)\Creative\AudioCS\"
WshShell.Run "CTAudCS.exe"
' lets open the console
While WshShell.AppActivate("Audio Control Panel") = FALSE
wscript.sleep 200
WshShell.AppActivate "Audio Control Panel"
Wend
'
' send some keystrokes to get the speaker settings box activated
'
'
WshShell.SendKeys("{TAB}{TAB}{TAB}{RIGHT}{TAB}{TAB}" )
'
' set the speaker selection to 2.1
'
WshShell.SendKeys("{2}" )
'
' exit Audio Control Panel -panel
'
WshShell.SendKeys("{TAB}{TAB}{ENTER}" )
WScript.Quit(0)
'----- End Of "Headphones to 2.1.vbs" -----
H - Headphones
2 - 2.1 Speakers
4 - 4.1 Speakers
5 - 5.1 Speakers
7 - 7.1 Speakers
Make sure the Control Panel is closed before you use these. You do not need to "Run as Administrator" on Vista; they just work. Also note that the program path assumes Vista x64 (which has a "Program Files (x86)" folder that does not exist on 32-bit Vista; it's just Program Files.)