Jump to content
DGFletcher

Script to turn on and off speakers?

Recommended Posts

DGFletcher

My (programmer...) boss recommended this to me.

I need a script that lets me one-click open start menu, control panel, hardware and sound, sound, right-click-on-speaker, disable Real-tek speakers, and then another one to turn it back on. 

I'm not a programmer... how hard would this be to set up? 

 

Share this post


Link to post
Share on other sites
SadBunny

Not that hard, but it would be quite the unwieldy solution to automate all of those windows. One thing I would certainly do is just start the sound control panel directly: 
control mmsys.cpl sounds (from start -> run or from the commandline). Shortcuts the first four steps right off the bat.

There are also many tools available for controlling these sorts of things directly, which are probably much quicker a solution than to learn to program (though if you want to learn then you can certainly use this as an exercise of course :) ). I googled and found this: http://www.nirsoft.net/utils/nircmd.html

All you have to do is execute a command like nircmdc mutesysvolume 1 to mute the system volume and nircmdc mutesysvolume 0 to un-mute it again. Put it in a batchfile or something. I guess that should fit your needs?

Good luck.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites
nitekram

Send ('{VOLUME_MUTE}') turns it off and run it again to turn it on


All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites
DGFletcher

Er, I have to turn Real Tek off to turn my work headphones on, so a basic mute won't work, unfortunately. 

Share this post


Link to post
Share on other sites
nitekram

Are you trying to use the headphone jack in the front of the computer for the headphones?

There are issues with Real Tek and those jacks...you may want to go into the properties and change that...

http://answers.microsoft.com/en-us/windows/forum/windows_7-pictures/realtek-hd-audio-manager-in-windows-7-disables-the/81569d98-8ffe-4fe7-b08a-8b37da9b3e67

EDIT

Also this http://www.spyontech.com/how-to/here’s-a-quick-way-to-solve-realtek-hd-audio-plugged-and-unplugged-problem.htm

EDIT 2

Video https://www.youtube.com/watch?v=Za3YOE_N0tQ

 

Edited by nitekram

All by me:

"Sometimes you have to go back to where you started, to get to where you want to go." 

"Everybody catches up with everyone, eventually" 

"As you teach others, you are really teaching yourself."

From my dad

"Do not worry about yesterday, as the only thing that you can control is tomorrow."

 

WindowsError.gif

WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF

AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send

StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2

AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit  Docs

SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF

Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language

Programming Tips

Excel Changes

ControlHover.UDF

GDI_Plus

Draw_On_Screen

GDI Basics

GDI_More_Basics

GDI Rotate

GDI Graph

GDI  CheckExistingItems

GDI Trajectory

Replace $ghGDIPDll with $__g_hGDIPDll

DLL 101?

Array via Object

GDI Swimlane

GDI Plus French 101 Site

GDI Examples UEZ

GDI Basic Clock

GDI Detection

Ternary operator

Share this post


Link to post
Share on other sites
Chimaera

On pcs we build we goto the options panel in the realtek menu and set the front jacks to AC97 sound then they both work, the hdmi does not work well with the front header.

May not help but i thought i would menton

Share this post


Link to post
Share on other sites
SadBunny

Send ('{VOLUME_MUTE}') turns it off and run it again to turn it on

​Holy cr*p.


Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×