-
Experienced User
how to write a BAT file to switch audio output
Hi all,
I have two audio cards in my PC:
one is an onboard audio card, and the other is an USB audio card.
Every time when I want to switch the audio output
(switch from the onboard audio output to the USB audio output),
I have to go to Control Panel and do some more steps.
I wonder if it is possible to write a BAT file to do this task for me?
Any ideas?
-
Pc Wizkid & Programmer :)
If the manual way is to stop one service and start a sevice then the Net Stop and Net Start mite help ,or if its a process that needs stopping and another process to run the other card the use TASKKILL /F /PID 1234 "pid 1234" is the process id num or use the command like this TASKKILL /F /IM "explorer.exe"
and to start a process use Start explorer.exe
then u could have two batch files ,one to stop one card and run then other ,and another batch file to swich back
take a look at your registry and note down the values in this key ,see if it changes when u change device.. ,u can make changes to the registry from batch files.. ,this mite point u in right direction..
[HKEY_USERS\S-1-5-21-1123561945-73586283-1417001333-1003\Software\Microsoft\Multimedia\Sound Mapper]
"Record"="Realtek HD Audio Input"
"PreferredOnly"=dword:00000001
"SetupPreferredAudioDevicesCount"=dword:00000001
"Playback"="Realtek HD Audio output"
Last edited by tangomouse; 06-22-2009 at 02:03 AM.
-
Administrator
Go to device manager and disable the onboard audio. I think that should do it.
-
Experienced User

Originally Posted by
tangomouse
If the manual way is to stop one service and start a sevice then the Net Stop and Net Start mite help ,or if its a process that needs stopping and another process to run the other card the use TASKKILL /F /PID 1234 "pid 1234" is the process id num or use the command like this TASKKILL /F /IM "explorer.exe"
and to start a process use Start explorer.exe
then u could have two batch files ,one to stop one card and run then other ,and another batch file to swich back
take a look at your registry and note down the values in this key ,see if it changes when u change device.. ,u can make changes to the registry from batch files.. ,this mite point u in right direction..
[HKEY_USERS\S-1-5-21-1123561945-73586283-1417001333-1003\Software\Microsoft\Multimedia\Sound Mapper]
"Record"="Realtek HD Audio Input"
"PreferredOnly"=dword:00000001
"SetupPreferredAudioDevicesCount"=dword:00000001
"Playback"="Realtek HD Audio output"
Hi tangomouse,
here is mine:

but I don't know how to create the BAT
-
Experienced User

Originally Posted by
Raymond
Go to device manager and disable the onboard audio. I think that should do it.
From what he is asking, I gather that he is not trying to disable the onboard audio. He merely wants to 'switch' between them (for whatever reason).
To do so with BATch files, you would either have to write one to switch from 'on board' to USB version, and another to switch back, or one, using error codes to select which one you wanted to use. In either case, you would still need to "Run" the BAT each time you wished to switch. I hate to say it, but Windows is not DOS, and the Windows solution (Control Panel) is probably quicker/easier than trying to deal with BATs in this case. I still have BATs in C:\Belfry (where else would you keep your BATs), but seldom use them. Some times they are labor saving devices, but with the current Windows environment, it's usually quicker to just go with the big W.
-
Administrator
Ah okay. I thought "she" only wanted to use the USB audio.
This would definitely help her out.
http://www.raymond.cc/blog/archives/2008/08/26/easily-change-or-switch-the-default-audio-sound-output-in-windows-vista-and-xp/
-
Experienced User
Ah okay. I knew Raymond had a solution! BATch files are great for repetitive tasks, but for single use purposes, the OS usually has an easier/quicker way to do it...if not, then thank god for 3rd parties.
Similar Threads
-
By kwfine in forum Software
Replies: 9
Last Post: 07-11-2010, 09:15 PM
-
By sabre2th in forum General Forum
Replies: 15
Last Post: 06-18-2010, 02:20 PM
-
By y0_gesh in forum Software
Replies: 5
Last Post: 01-27-2010, 04:22 AM
-
By Firstmate in forum General Forum
Replies: 3
Last Post: 02-01-2009, 01:42 PM
-
By kwfine in forum Hardware
Replies: 3
Last Post: 07-12-2007, 06:19 PM
All times are GMT +8. The time now is 03:28 AM.