Having the microphone volume level reset to 100 every time after you change it is pretty irritating; specially if you use your microphone a lot. This problem seems to be very common in Windows machines and there are no fixes for it. I’m going to teach a script to get around this issue using nircmd.
Table of Contents:
1. Installing NirCmd
2. The script and startup
3. Script explained
4. Killing the script and re-executing it
1. Installing NirCmd
NirCmd can be installed from NirSoft’s website or directly from https://www.nirsoft.net/utils/nircmd.zip.
After downloading it, copy the nircmdc
file from the zip you downloaded and paste it into %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
(The directory defined in user’s PATH environment variable). Now nircmdc
is installed!
Search for and open cmd. You’ll be given a command line interface. Type in nircmdc
and press enter; if the result is anything like the given picture, then “NirCmd” is installed and we can move on:
NOTE: This process does not require administrator privileges.
2. The script and startup
Now that we know that nircmdc
is installed, we can move on to writing the vbs script and make it run on startup! Open up notepad and copy the following code inside it:
Set objShell = WScript.CreateObject("WScript.Shell")
Do While True
objShell.Run("nircmdc loop 172800 1000 setsysvolume 57016 default_record"), 0, True
Loop
After you copied this to notepad, go to “File”, tap “Save As” then enter the name as “mic_locker.vbs” (any name with a .vbs suffix) and set “Save as Type” to “All Files” and save it to %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
for startup:
3. Script explained
This script runs a while true loop and calls nircmdc
in it which runs a loop as well. This will decrease how many times nircmdc
is called; In turn having very low cpu usage.
The main command used is nircmdc loop 172800 1000 setsysvolume 57016 default_record
. The nircmdc
command changes the “default record device” volume/level every second for 172800 times to 57016 or 87%.
The full volume is 65535; so if you want 87%, you multiply 65535 by 0.87(%87); giving us 57016. That’s all you need for customizing the script.
Full nircmdc manual is available here: https://www.nirsoft.net/utils/nircmd2.html#using
4. Killing the script and re-executing it
If you want to change the volume manually or change the values of the command, you need to kill it first.
Do this by going to Task manager -> Details
; then sort by name, find wscript.exe
and right-click and End process tree
to kill the script and nircmdc
together.
For re-execution, all you need to do is going to %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
and executing the script again. No windows appear, no hassle!
38 replies on “How to lock the Microphone Volume Level in Windows”
RE: Windows command line tool called “NirCmd”. NirSoft provide this, (and many other) handy utilities, they don’t come as part of windows 10. It is a simple download.
Windows 7 was packed with this, also remember windows 10 as well, but i guess they removed it. Updating the article…
Thank you very much, I couldn’t change the volume options in MS Teams with my blue yeti microphone.
The .bat window isn’t hide after startup. What should I do?
I updated the article, use the new script.
Thank you very much!
Here “%USERPROFILE%\AppDataRoaming\Microsoft\Windows\Start Menu\Programs\Startup” you missed a “\” after AppData. 😛
I encountered some rather odd speaker issues while on a Zoom call and I decided to delete all the programs I was using to lock the mic volume. I successfully deleted the .vbs file and nircmdc but wscript.exe says it can’t be deleted without the permission of “TrustedInstaller”. I couldn’t find any tutorials on deleting the .exe that were compatible with Windows 10 and I was hoping you could provide some insight.
All the programs you just mentioned only reside on your computer and do nothing unless you run the script or execute them.
These programs(wscript.exe, nircmdc) are fundamental to windows and should not be deleted(although nircmcd was installed by you so it’s fine). Just remove the script from the startup folder and don’t execute the script and it’s all fine.
wscript is stock Windows software. Do not delete it. Sounds like your operating system is trying to prevent you from deleting one of many important stock system files and programs. Nircmdc is fine to delete, but there’s a reason why it’s stopping you from deleting wscript!
LOl even with this my microphone volume still auto-adjusts because of chrome. It’s true that this command helps the volume stays locked up to my desired level but then it still adjusts from time to time then go back to the locked volume. lol This has been an ongoing problem with Chrome.
What do you mean by “from time to time”? I added a 1000 milliseconds delay so the cpu wouldn’t wake up as much; so if your volume intermittently goes up every second, lower this delay to 100. Let me how it goes.
The only volume setting this ever sets my microphone to is 0, even when I’ve made no changes to the raw copied script. Is there a value somewhere I should be changing?
Sorry that happens. Try only running
nircmdc loop 172800 1000 setsysvolume 57016 default_record
in cmd with the script stopped or removed/disabled. Let me know what happens.Running that in cmd sets the volume to 87 correctly. Which is strange because running the script through notepad doesn’t do that.
I just tried running the script again and now it works. I have no idea what’s changed but I’m glad it works now.
Hi,
Thanks for sharing this information. I have done it in my windows 10 pro on my laptop. But I have a desktop running windows 7 ultimate service pack1, And I want to do this in my desktop. So the problem is this that this path “%USERPROFILE%\AppData\Local\Microsoft\WindowsApps”
is not available same to same in my desktop. It last folder is Microsoft and there is no WindowsApp folder available. Please help me how to do this in my desktop. Thanks.
Hi, I assumed the most prevalent OS would be Windows 10 and wrote the article in a way that you can do it without Administrator access. But you can place the executable in the directory
%SystemRoot%\system32\
as well if you have Administrator access and it’ll work just fine. Let me know if it works.It worked man! Thanks very much. I was really bothered with this windows problem of automatically adjusting the volume of mic. I have seen many videos on youtube and read some articles on web as well but couldn’t find solution anywhere. The way you have written this article is really eye catchy, very simple to understand and implement without needing any further help. Thank you so much bro. Take Care.
One more thing I would like to ask you brother. In my windows 7 ultimate I have the option to end process tree and I can edit it easily according to my choice. But in windows 10 pro when I click on task manager under processes it is only showing NirCmd(32 bit) and when I right click on it there is no option like “end process tree”, It has the option “end task” only and in the same task manager there is one more column “Startup” and it has mic_locker and it has the option of enable and disable. So do I have to click on end task and continue with editing or Do I have to disable mic_locker for editing? Or anything you would like to me guide me?
Entry in the startup tab just allows you to enable or disable its startup after restarting your computer not while it’s running; so yes you just have to the “end task”.
Ya it’s working now I can edit in windows 10 pro as well. Thanks!!
In windows 10 pro in task manager in Details column it is not showing wscript.exe option.
This is a life saver. Imagine having a studio XLR mic, using it for conference calls, facebook calls, Discord ect. and the mic level randomly jumping from 50 to 100. I literally had to keep Microphone Properties open to check if my volume didn’t jump to 100, when I usually use 70…
I’ve been finding a solution to windows 10 auto adjusting mic vol for a few weeks. By adjusting the ms of this script, It solved my problem. Thank you!
I get this error while following the instructions. Is there something I should be doing otherwise?
Hmmm, seems like you gave the wrong path to the script. Retrace your steps
Like in step 2? Do you mean saving the script to the wrong location or do I have to change something in the script itself? I retraced everything and it seems like I followed all the steps correctly.
Oh sorry about that, just had time to confirm. The script location is fine. You don’t have nircmd installed it seems. In step 1, can you confirm in powershell that nircmdc is installed? If not, then the PATH environment variable needs to be changed. to include where nircmd is located.
It seems like nircmd is installed based on this.
What are your Environment variables?
Sorry, I’m not too technical I don’t really know what this means.
Just search up environment variables in the search bar and then you can see them. Give me a picture of that. Also, don’t start cmd in administrator mode; It should work as a normal user.
I tested the entire article in a windows 10 virtual machine and it seems to be working fine.
I think this is it? Also ran nircmdc normally but still get the same error.
Hmmm, are you running the script as an admin maybe? The only problem is that windows can’t find nircmdc. Worst case scenario, just copy nircmdc to system32.
Copying the files to system 32 did the trick. Thank you for your patience in helping me!
No problems, man windows is a mystery 😀
thx very much for this guide
10/10
Man you saved me, I used to have an older version of a script i found on yt and worked fine for months but since I put windows LTSC it wouldn’t work anymore properly like it would close down on its own after a while, I even changed my sound interface because of that just in case my cheap behringer was doing something but…to no avail it happened again and again, now this one been tested and works so good, THANK YOU.