vbscript - How to I control my computer master volume by batch file -
i have batch code can turn pc volume wont turn down volume here code please possible:
@if (@a==@b) @end /* :: batch portion @echo off cscript /e:jscript "%~f0" :: jscript portion */ var shl = new activexobject("wscript.shell"); (var i=0; i<5; i++) { shl.sendkeys(string.fromcharcode(0xaf)); }
this code enable turn pc volume how turn down pc volume me
these tested , work here - keycodes in microsoft link in comment below.
volume control up.bat
@if (@a==@b) @end /* :: batch portion @echo off cscript /e:jscript "%~f0" :: jscript portion */ var shl = new activexobject("wscript.shell"); (var i=0; i<5; i++) { shl.sendkeys(string.fromcharcode(0xaf)); }
volume control down.bat
@if (@a==@b) @end /* :: batch portion @echo off cscript /e:jscript "%~f0" :: jscript portion */ var shl = new activexobject("wscript.shell"); (var i=0; i<5; i++) { shl.sendkeys(string.fromcharcode(0xae)); }
original answer follows:
according comment kul-tigin
below, correct code should ae
shl.sendkeys(string.fromcharcode(0xaf));
you can use utility show keycodes when press , down volume buttons, assuming find utility returns keycode them.
the utility have show af
hex or 175
decimal up
volume key, , should show correct number down volume key.
Comments
Post a Comment