Results 1 to 7 of 7
  1. #1
    Experienced User
    Overall activity: 6.0%

    Join Date
    Dec 2006
    Location
    Taiwan + Australia
    Posts
    321
    Liked
    0 times
    Points
    14,645

    Search 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?

  2. #2
    Pc Wizkid & Programmer :)
    Overall activity: 3.0%

    Join Date
    Jun 2008
    Location
    Rotherham, United Kingdom
    Posts
    1,195
    Liked
    48 times
    Points
    12,033
    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.

  3. #3
    Administrator
    Overall activity: 46.0%

    Join Date
    Nov 2006
    Location
    Malaysia
    Posts
    9,802
    Liked
    1656 times
    Points
    48,740
    Go to device manager and disable the onboard audio. I think that should do it.

  4. #4
    Experienced User
    Overall activity: 6.0%

    Join Date
    Dec 2006
    Location
    Taiwan + Australia
    Posts
    321
    Liked
    0 times
    Points
    14,645
    Quote Originally Posted by tangomouse View Post
    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

  5. #5
    Experienced User
    Overall activity: 0%

    Join Date
    May 2008
    Location
    Seattle, WA
    Posts
    1,620
    Liked
    1 times
    Points
    9,515
    Quote Originally Posted by Raymond View Post
    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.

  6. #6
    Administrator
    Overall activity: 46.0%

    Join Date
    Nov 2006
    Location
    Malaysia
    Posts
    9,802
    Liked
    1656 times
    Points
    48,740
    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/

  7. #7
    Experienced User
    Overall activity: 0%

    Join Date
    May 2008
    Location
    Seattle, WA
    Posts
    1,620
    Liked
    1 times
    Points
    9,515
    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

  1. Replies: 9
    Last Post: 07-11-2010, 09:15 PM
  2. No headphone output on laptop?
    By sabre2th in forum General Forum
    Replies: 15
    Last Post: 06-18-2010, 02:20 PM
  3. Replies: 5
    Last Post: 01-27-2010, 04:22 AM
  4. A lot of output from netstat
    By Firstmate in forum General Forum
    Replies: 3
    Last Post: 02-01-2009, 01:42 PM
  5. no audio output from the orange mini jack
    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.