1

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?

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.

| improve this answer | |

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