WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How do I turn on sound with a script/batch file? (WinXP Ho..

 
   Home -> Windows -> Help & Support RSS
Next:  Problem signing in to Compuserve forums  
Author Message
Fuzzy

External


Since: Dec 16, 2007
Posts: 9



(Msg. 1) Posted: Sat May 02, 2009 1:51 pm
Post subject: How do I turn on sound with a script/batch file? (WinXP Home P3)
Archived from groups: microsoft>public>windowsxp>help_and_support (more info?)

What I need is a script/batch file that can turn on / turn off audio,
(as if the speaker icon was muted and un-muted). I have software to
run a program / script / batch file, play a sound file, wake and hibernate
the system. I just need to ensure that sound is not muted when it needs to be
played. The laptop does have fn-f6 as a key combo to do the sound toggle
but I don't know how to emulate the keystroke's.

Anyone have any idea.

Thanks
Back to top
Login to vote
Alister

External


Since: May 02, 2009
Posts: 6



(Msg. 2) Posted: Sat May 02, 2009 7:05 pm
Post subject: Re: How do I turn on sound with a script/batch file? (WinXP Home [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Fuzzy wrote:
> What I need is a script/batch file that can turn on / turn off audio,
> (as if the speaker icon was muted and un-muted). I have software to
> run a program / script / batch file, play a sound file, wake and hibernate
> the system. I just need to ensure that sound is not muted when it needs to be
> played. The laptop does have fn-f6 as a key combo to do the sound toggle
> but I don't know how to emulate the keystroke's.
>
> Anyone have any idea.
>
> Thanks
>
>

Using VBscript you can control the master volume Mute with the following:


Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(173))

or (using Hex values)

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys(chr(&hAD))

This sends the keycode value used by multimedia keyboards and is a toggle.

HTH

Alister
Back to top
Login to vote
Fuzzy

External


Since: Dec 16, 2007
Posts: 9



(Msg. 3) Posted: Sat May 02, 2009 7:05 pm
Post subject: Re: How do I turn on sound with a script/batch file? (WinXP Home P [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ok

what do I do (do the lines go in a txt type file like bat and cmd files)?
what extention is used?

what program runs it? cmd.com?




"Alister" wrote:

> Fuzzy wrote:
> > What I need is a script/batch file that can turn on / turn off audio,
> > (as if the speaker icon was muted and un-muted). I have software to
> > run a program / script / batch file, play a sound file, wake and hibernate
> > the system. I just need to ensure that sound is not muted when it needs to be
> > played. The laptop does have fn-f6 as a key combo to do the sound toggle
> > but I don't know how to emulate the keystroke's.
> >
> > Anyone have any idea.
> >
> > Thanks
> >
> >
>
> Using VBscript you can control the master volume Mute with the following:
>
>
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.SendKeys(chr(173))
>
> or (using Hex values)
>
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.SendKeys(chr(&hAD))
>
> This sends the keycode value used by multimedia keyboards and is a toggle.
>
> HTH
>
> Alister
>
>
>
Back to top
Login to vote
Fuzzy

External


Since: Dec 16, 2007
Posts: 9



(Msg. 4) Posted: Sat May 02, 2009 7:05 pm
Post subject: Re: How do I turn on sound with a script/batch file? (WinXP Home P [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

never mind... I figured it out.

its like another script program... txt type file with vbs extension.
when ran that, it open a console windows did its thing and exited.
Works exactly as the fn-f6 key does toggle the x on the speaker icon.

thanks Smile


"Fuzzy" wrote:

> Ok
>
> what do I do (do the lines go in a txt type file like bat and cmd files)?
> what extention is used?
>
> what program runs it? cmd.com?
>
>
>
>
> "Alister" wrote:
>
> > Fuzzy wrote:
> > > What I need is a script/batch file that can turn on / turn off audio,
> > > (as if the speaker icon was muted and un-muted). I have software to
> > > run a program / script / batch file, play a sound file, wake and hibernate
> > > the system. I just need to ensure that sound is not muted when it needs to be
> > > played. The laptop does have fn-f6 as a key combo to do the sound toggle
> > > but I don't know how to emulate the keystroke's.
> > >
> > > Anyone have any idea.
> > >
> > > Thanks
> > >
> > >
> >
> > Using VBscript you can control the master volume Mute with the following:
> >
> >
> > Set WshShell = CreateObject("WScript.Shell")
> > WshShell.SendKeys(chr(173))
> >
> > or (using Hex values)
> >
> > Set WshShell = CreateObject("WScript.Shell")
> > WshShell.SendKeys(chr(&hAD))
> >
> > This sends the keycode value used by multimedia keyboards and is a toggle.
> >
> > HTH
> >
> > Alister
> >
> >
> >
Back to top
Login to vote
Alister

External


Since: May 02, 2009
Posts: 6



(Msg. 5) Posted: Sat May 02, 2009 8:05 pm
Post subject: Re: How do I turn on sound with a script/batch file? (WinXP Home [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Fuzzy wrote:
> Ok
>
> what do I do (do the lines go in a txt type file like bat and cmd files)?
> what extention is used?
>
> what program runs it? cmd.com?

Create a new text file in notepad, copy those lines into it (Only copy
one set - either the decimal version or the Hex version - it doesn't
matter) and save it as mute.vbs (Note that in notepad it will stick a
..txt on the end unless you save as type "All Files") Save it to
somewhere where you can find it - either on your desktop or in the root
of C:\ If you saved it to the desktop then double-clicking it will run
it. If you want to run it programaticaly then you can set it as a
scheduled task or run it from within a batch file. You said you already
had some software to run a batch file, so you should be able to call it
direct from there.

Alister
Back to top
Login to vote
Alister

External


Since: May 02, 2009
Posts: 6



(Msg. 6) Posted: Sat May 02, 2009 8:05 pm
Post subject: Re: How do I turn on sound with a script/batch file? (WinXP Home [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Fuzzy wrote:
> never mind... I figured it out.
>
> its like another script program... txt type file with vbs extension.
> when ran that, it open a console windows did its thing and exited.
> Works exactly as the fn-f6 key does toggle the x on the speaker icon.
>
> thanks Smile
>

No problem.

The only difficulty is it just toggles Mute on or off - there is, to my
knowledge, no way of checking whether the sound is muted in VB script.
So you would have to know in advance which way it is set.

Alister
Back to top
Login to vote
Fuzzy

External


Since: Dec 16, 2007
Posts: 9



(Msg. 7) Posted: Sat May 02, 2009 8:05 pm
Post subject: Re: How do I turn on sound with a script/batch file? (WinXP Home P [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Where can find doc on what that script language supports?

it seems kinda like the various different unix type shells
which would be very helpful since command.com and
cmd.com don't do a whole lot that way.

thanks again

"Alister" wrote:

> Fuzzy wrote:
> > Ok
> >
> > what do I do (do the lines go in a txt type file like bat and cmd files)?
> > what extention is used?
> >
> > what program runs it? cmd.com?
>
> Create a new text file in notepad, copy those lines into it (Only copy
> one set - either the decimal version or the Hex version - it doesn't
> matter) and save it as mute.vbs (Note that in notepad it will stick a
> ..txt on the end unless you save as type "All Files") Save it to
> somewhere where you can find it - either on your desktop or in the root
> of C:\ If you saved it to the desktop then double-clicking it will run
> it. If you want to run it programaticaly then you can set it as a
> scheduled task or run it from within a batch file. You said you already
> had some software to run a batch file, so you should be able to call it
> direct from there.
>
> Alister
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Windows -> Help & Support All times are: Eastern Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum
Categories:
  Windows XP
 Windows Vista
 Windows Other
 Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Help Forum Terms of Service |
  • Link to WUGNET |
  • IT Support