Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

protected by slhck Sep 22 '11 at 10:32

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

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

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