I want a script for Windows 7, so I can type "vol 50", and the volume will change by 50%, "vol 0" and turn off, etc.
It should be really simple, right?
Apparently, this is not so, and I wasted more than an hour, wading through long explanations of boring things, when people explain the differences between Win 7 and Win XP or between a master volume and other volumes and other things, I tell you what I need .
I found this page: http://msdn.microsoft.com/en-us/library/ms679141.aspx
So I tried to create a test set_vol_50.vbs script that looks like this:
SetMasterVolume 0.5 , NULL
This results in an error:
Script: <path>\set_vol_50.vbs Line: 1 Char: 1 Error: Type mismatch: 'SetMasterVolume' Code: 800A000D Source: Microsoft VBScript runtime error
This is not particularly useful (and not one of them is trying to use Google).
Do I need to somehow throw 0.5 on the float?
Is it wrong to use NULL for the second argument?
I am not married to vbscript for this - all I want to do is global volume level for Windows 7 - as soon as the end result is a simple executable file that can take a percentage, I will be happy.
How can I do it?
source share