Batch File: Mask user input

By Blekk
Feb 18, 2009
  1. Hello,

    I was just messing around last night while bored and realised that it takes me a few minutes to start up everything I want on the internet when I want it so thought I would create a batch file to do it for me. But I've hit a security problem:

    I am going through my university's VPN connection to get onto the internet and therefore I need to enter a username and password, I have used rasdial for this and it works perfectly but I didn't want my password stored in the .bat because then anyone could steal it and use it.

    Therefore I made the batch file ask for the password before executing the rasdial line, the only thing is, anyone shoulder-surfing me would be able to see my typing the password in as it comes up in the command prompt window when you type.

    I was wondering if there was a way to mask user input for a batch file the same way that other user input is done, such as replacing whatever is typed with an asterisk such as:

    "Enter Password: ********" rather than "Enter Password: mypassword" being displayed in the command prompt.

    Thanks in advance,

  2. kimsland

    kimsland Ex-TechSpotter Posts: 14,523

    From here:
Topic Status:
Not open for further replies.

Similar Topics

Add your comment to this article

You need to be a member to leave a comment. Join thousands of tech enthusiasts and participate.
TechSpot Account You may also...