Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an autohotkey script that maps multiple network drives using a series of net use commands. I enter my password once into an autohotkey inputbox, then run all of the net use commands with the entered password. This works great as long as I enter the correct password. If I mistype my password it runs all the net use commands with an incorrect password and my account ends up locked out.

Aside from catching the error code/output from the net use command, is there some other way (through Autohotkey/Windows command-line) to verify the username/password combo is correct before I run it multiple times?

share|improve this question

A simple way would be to store your credentials in an MD5 hashed file, or store the hash in the program as a variable for comparison. When you input your details into the inputbox, have them hashed and compared against the predefined hash.

You can find an MD5 implementation that is easy to use with AHK here. An example is provided.

This is one of the easier ways to accomplish this. I'm not sure of an easy way to interact with the SAM database via AHK.

share|improve this answer

You must log in to answer this question.

protected by slhck Sep 22 '11 at 10:32

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .