How can I mute/unmute my sound from PowerShell

后端 未结 10 2205
孤独总比滥情好
孤独总比滥情好 2020-11-29 06:14

Trying to write a PowerShell cmdlet that will mute the sound at start, unless already muted, and un-mute it at the end (only if it wasn\'t muted to begin with). Couldn\'t fi

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-29 06:39

    Solution in vbscript:

    Set WshShell = CreateObject("WScript.Shell")
    For i = 0 To 50
      WshShell.SendKeys(chr(174))
      WScript.Sleep 100
    Next
    

    The keys reduce the volume by 2 each time.

提交回复
热议问题