Some commands require putting in the password as one of the arguments (like net use, for example). Is it possible to run a command or change a setting in Command Prompt so that whatever I am typing does not show up on the screen? I basically want to type something without seeing what I'm typing and then press enter and have the command execute (the output can show).

Note that this is NOT for a batch file.

  • You can, of course, create a batch file to input a password param without using echo. – DrMoishe Pippik Aug 3 '15 at 19:21

Use an asterisk (*) instead of your password in net use

In Microsoft Technet we read:

Net use


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 password prompt.

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

Command prompt properties

After typing your command, this command will change back to original using this command:

color 07

or this

color /t

Note: You should clear screen before returning back to the original color using

  • 1
    It works but you can still get the text by marking or selecting. That would not be useful for hiding a password that Is typed. – MC10 Aug 3 '15 at 19:32
  • @MC10 What do you mean by hiding? It is not possible to completely hide it. If OP describe your exact purpose, maybe I can help. – Ho1 Aug 3 '15 at 19:34
  • echo off and echo on would just change when the system reports back – El Turner Aug 3 '15 at 19:35
  • It may be impossible to hide, so that is what we should tell OP. I don't have a purpose and I think OP's purpose is to prevent passwords being typed in to be visible. – MC10 Aug 3 '15 at 19:36
  • @MC10 I think the use case is clear: Typing passwords in a hidden way. So I think the above commands does the job. Isn't it? – Ho1 Aug 3 '15 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.