This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How long it should wait between every loop in seconds | |
$secondsToWait = 5 | |
# The volume you want in percent (0.92 = 92%) | |
$volume = 1.00 | |
Write-Host "Starting invinite loop, press CTRL + C or close the window to stop" | |
while (1) { | |
Start-Process -FilePath "nircmd.exe" -WorkingDirectory $PSScriptRoot -ArgumentList "setsysvolume $([math]::floor(65535 * $volume))","default_record" -Wait | |
Write-Host "Volume set to $($volume * 100)%" | |
Start-Sleep -Seconds $secondsToWait |