Platform : Windows 9X, XP, Vista, Window 7
For Windows Developers who need to control sound volume in vb.net, c++, c#, vb, delphi, vfp, access.
Step 1: Download trial version of Sound Volume ActiveX and installed it.
Step 2: Create text file and add following code and save to test.vbs
Set obj=CreateObject("SOUNDVOLUME.SoundVolumeCtrl.1")
if obj.IsVistaWindows7 then
obj.W7SetCurrentDevice obj.W7GetSpeakersName(0)
obj.W7SetDeviceVolume 0
MsgBox "set the master volume of first speaker " obj.W7GetSpeakersName(0) " to 0"
End If
Step 3: double click test.vbs, It will set the first speaker volume to 0. Some system have two speakers, so you need select correct speaker , the following code select second speaker.
obj.W7SetCurrentDevice obj.W7GetSpeakersName(1)