Dienstag, 20. Oktober 2009

Read password from script

For a script that connects to several shares, I wanted to be able to prompt the user to enter the password. Of course, when entering the password its characters should not be printed on the screen, instead a '*' should appear.

I did not find an easy, ready available way to achieve this, so i created my own solution for this: A simple (.NET) console application reads the password in the manner i wanted and creates a .cmd script that, when called sets a script variable. This script variable can then be used. Of course the script must be deleted and the variabale reset after usage.

I know that this is not 100% secure, but its enough for my usage.

The .exe, a sampe script, and the .NET solution can be found here.

Keine Kommentare:

Kommentar veröffentlichen