How to adjust volume using batch files

0

I want to know how to set volume with cmd but can't download software. I know it is possible because I had it but deleted it. opps

Little programmer

Posted 2015-05-20T08:17:08.440

Reputation: 1

Question was closed 2015-10-13T17:14:14.227

Answers

0

Save this as a .VBS file and use as a template to do what you want. You can find more help about the SendKeys method here.

set WshShell = CreateObject("WScript.Shell")
WshShell.Run "%SystemRoot%\System32\SndVol.exe"
WScript.Sleep 1000
WshShell.AppActivate "Volume Mixer"
WshShell.SendKeys "{PGUP}" ' Turn the volume up by 20. If muted it will unmute it.
WshShell.SendKeys "%{F4}"  ' Alt+F4

You can call it from a batch file using cscript SetVol.vbs (or whatever name you used obviously).

Karan

Posted 2015-05-20T08:17:08.440

Reputation: 51 857