lewando54
lewando54

Reputation: 37

wshShell.SendKeys(Chr(175)) doesn't work

I'm trying to write a script that will be turning the volume up in Wndows 10. But there's a problem because this particular keystroke that cranks volume up doesn't work. The mute and volume down works perfectly.

Set wshShell = CreateObject("WScript.Shell")

For i = 0 To 50
    wshShell.SendKeys(Chr(175))
Next

Upvotes: 1

Views: 752

Answers (1)

user9556248
user9556248

Reputation:

You can use NirCmd tool.

Example :

Set WshShell = WScript.CreateObject("WScript.Shell")

' Increase the system volume by 20000 units (out of 65535)
WshShell .Run("nircmd.exe changesysvolume 20000")

' Decrease the system volume by 5000 units
WshShell .Run("nircmd.exe changesysvolume -5000")

Upvotes: 1

Related Questions