|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need XP Volume Mute Script
Hello,
I work in an educational environment with several computer labs running Windows XP. I have been trying to find a script that I could deploy to all machines (via Altiris), but thus far I've come up empty. Here's what I need the script to be able to do: 1) Mute the system volume (like through mmsys.cpl) on the machine. AND 2) Place (i.e. display) the volume control speaker icon into the System Tray. Can someone help me out with this? I thought this would be a relatively easy thing to find online but so far it hasn't proven to be so. Most everything I have found related to this deals with HotKeys and I want to avoid going down that road. Thanks so much. |
|
#2
|
||||
|
||||
|
Need XP Volume Mute Script
it can be done through group policy by running vbscript on the required computers, only need to once as it will mute the HKLM key.
Code:
set oshell=createobject("wscript.shell")
oshell.run "sndvol32"
oshell.appactivate "volume control"
wscript.sleep 100
oshell.sendkeys "{tab}+{tab}"
oshell.sendkeys "m "
oshell.appactivate "volume control"
wscript.sleep 100
oshell.sendkeys "%{f4}"
__________________
Hope this advise helps. ![]() If so please show your appreciation by adding reputation points (click gauge image on top right of this post and score).
|
|
#3
|
||||
|
||||
|
That's what I was going to do. Good answer. One thing I would recommend it some error-handling to make sure that the proper Windows are in focus, otherwise all is lost.
__________________
Click the image if at any point you don't like my decision.Scripting problems? Windows questions? Ask the Windows Guru! |
|
#4
|
|||
|
|||
|
A better solution is send just the Windows keycode
here's a better solution... found on blogger at frontierdg.blogspot.com
Uses the Windows keycode 173, which is the same keycode that multimedia keyboards use to mute the sound. ![]() |
|
#5
|
||||
|
||||
|
Nice job. Here's the code:It's also important to know that you can use hex values as well. This is nice since most references refer to key codes by their hex value. In this case, the mute button is 0xAD.
Last edited by Nilpo : November 7th, 2008 at 05:17 PM. |
![]() |
| Viewing: ASP Free Forums > System Administration > Windows Scripting > Need XP Volume Mute Script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|