Use an asterisk (*) instead of your password in
In Microsoft Technet we read:
Password: Specifies the password needed to access the
shared resource. Type an asterisk (*) to produce a prompt for the
password. The password is not displayed when you type it at the
So, just use * (a single asterisk) instead of your password in the command line, and then you will be prompted to type your password and it is not displayed on the screen.
Other possible use cases:
There may be other use cases rather than
net use, so this is a general answer to the question:
Please note that you should assume that there is usually no way to completely hide what you are typing from everyone, and these are some tricks to hide it from the curious people who stare at your monitor!
Solution 1: Changing color
One solution is changing the foreground color to black on a black background. You can not do this in command line by issuing the command
color 00 because it returns error when you try to use the same color for both the foreground and the bacground. So, do this using properties of the command prompt window
After typing your command, this command will change back to original using this command:
Note: You should clear screen before returning back to the original color using