Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control volume\speakers using a script?

Status
Not open for further replies.
Feb 22, 2005
39
BM
I'm looking for a way to control the volume on a remote computer using a script. Is this possible? Ideally, their would be a script to turn the volume up all the way and another script to turn the volume all the way down.
Any suggestions?
 
I think you are in for a rough ride to accomplish this. I belive it will be different registry keys for each type of sound card in your environment.

best advice I could offer to isolate what controls this would be to use a program like regSnap to take a snapshot of your system witht he volume set at the lowest setting. Then change it to the highest and do another RegSnap. Then let the program compare the two and tell you what changed.

Once you have the registry keys identified you could script them.


I hope you find this post helpful.

Regards,

Mark
 
Thanks for the idea. Would this be possible? Is their a way to control the sndvol32.exe file? That file is the executable for Master Volume. Is their a script to control that?
 
There has to be a setting saved someplace, either a registry key or an ini file. of course if you can do it from a command line it can be scripted.

I hope you find this post helpful.

Regards,

Mark
 
'Plagerized from someone in some forum :) Not exactly what you want, but it does mute.

set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 600
oshell.sendkeys "m"
wscript.sleep 600
oshell.sendkeys Chr(32)
wscript.sleep 600
oshell.appactivate "volume control"
wscript.sleep 600
oshell.sendkeys "%{f4}
 
After playing with that a tiny bit I have found you could do the following to max out the volume:

Code:
set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 600
For X = 1 To 500
    oshell.sendkeys "^{UP}"
    oshell.appactivate "volume control"
Next
wscript.sleep 600
oshell.appactivate "volume control"
wscript.sleep 600
oshell.sendkeys "%{f4}"

And this will set it to the lowest setting (non-muted)
Code:
set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
WScript.sleep 600
oshell.appactivate "volume control"
oshell.sendkeys "{tab}"
wscript.sleep 600
For X = 1 To 500
    oshell.sendkeys "^{DOWN}"
    oshell.appactivate "volume control"
Next
wscript.sleep 600
oshell.appactivate "volume control"
wscript.sleep 600
oshell.sendkeys "%{f4}"

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top