Hi all,

Does anyone have any VBScript for toggling the mute control on the volume
control?

--

HTH

Bob Phillips

Re: Volume mute by Fosco

Fosco
Fri Sep 19 00:07:29 CDT 2003

"Bob Phillips"
> Does anyone have any VBScript for toggling the mute
> control on the volume control?

set oShell = CreateObject("WScript.Shell")
oShell.run"Sndvol32"
WScript.Sleep 1500
oShell.SendKeys"{TAB 2} "
' note the space after {TAB 2}
--
Fosco




Re: Volume mute by Bob

Bob
Fri Sep 19 01:11:36 CDT 2003

Fosco,

Thanks for that.

A couple of follow-ups,
- can it be modified to close the volume control screen down afterwards
- or can it re-use the previous instance, not a new one each time?

--

HTH

Bob Phillips

"Fosco" <fake@fake.invalid> wrote in message
news:lawab.117285$R32.3561114@news2.tin.it...
> "Bob Phillips"
> > Does anyone have any VBScript for toggling the mute
> > control on the volume control?
>
> set oShell = CreateObject("WScript.Shell")
> oShell.run"Sndvol32"
> WScript.Sleep 1500
> oShell.SendKeys"{TAB 2} "
> ' note the space after {TAB 2}
> --
> Fosco
>
>
>



Re: Volume mute by Fosco

Fosco
Sat Sep 20 23:39:17 CDT 2003

"Bob Phillips"
> can it be modified to close the volume control screen down afterwards

set oShell = CreateObject("WScript.Shell")
oShell.run"Sndvol32"
WScript.Sleep 1500
oShell.SendKeys"{TAB 2} "
WScript.Sleep 500
' If oShell.AppActivate( "Controllo volume") Then
'Change "Controllo volume" with your caption
' maybe "Volume Control" ??? >> cAse sEnsiTiVe
'(you can catch it with CTRL+ALT+DEL) and remove '
oShell.SendKeys"%{F4}"
Else
Wscript.Echo "NO Sndvol32 Caption"
End if


> or can it re-use the previous instance, not a new one each time?

oShell.AppActivate("CAPTION")
--
Fosco








Re: Volume mute by Murphy

Murphy
Sun Sep 21 00:39:01 CDT 2003

"Bob Phillips" <bob.phillips@tiscali.co.uk> wrote in message
news:u80x2wTfDHA.696@TK2MSFTNGP09.phx.gbl...
...
> Does anyone have any VBScript for toggling the mute control on the volume
...

Do you require that it work in "pure" VBScript -- without any COM components
installed?


Murphy
www.ConstantThought.com



Re: Volume mute by Bob

Bob
Sun Sep 21 17:20:23 CDT 2003

Thanks mate, that's great.

In the end I decided to re-use as it is likely that I want to change the
volume as well. But first time I need CreateObject, so my final version
looks like

On Error Resume Next
Set oShell = AppActivate("Volume control")
If oShell Is Nothing Then
Set oShell = CreateObject("WScript.Shell")
End If
oShell.run"Sndvol32"
WScript.Sleep 1500
oShell.SendKeys"{TAB 2} "


Thanks again

Bob

"Fosco" <fake@fake.invalid> wrote in message
news:VX9bb.94199$hE5.3310993@news1.tin.it...
> "Bob Phillips"
> > can it be modified to close the volume control screen down afterwards
>
> set oShell = CreateObject("WScript.Shell")
> oShell.run"Sndvol32"
> WScript.Sleep 1500
> oShell.SendKeys"{TAB 2} "
> WScript.Sleep 500
> ' If oShell.AppActivate( "Controllo volume") Then
> 'Change "Controllo volume" with your caption
> ' maybe "Volume Control" ??? >> cAse sEnsiTiVe
> '(you can catch it with CTRL+ALT+DEL) and remove '
> oShell.SendKeys"%{F4}"
> Else
> Wscript.Echo "NO Sndvol32 Caption"
> End if
>
>
> > or can it re-use the previous instance, not a new one each time?
>
> oShell.AppActivate("CAPTION")
> --
> Fosco
>
>
>
>
>
>
>