superfletch (15th August 2008)
Hello there,
Does anyone know how you can get a DOS (batch/cmd) file to hide or produce asterisks for certain characters when a user inputs them?
What I'm doing uses a combination of AutoIt and cmd files. My AutoIt code takes a password from a user (which is asterisked out when they type it into the GUI) and passes it back into a cmd file. I can't find a way to asterisk out the input from AutoIt into the cmd file though.
I tried using the _RunDos command in AutoIt but I can't tell if the cmd file is working like that as I need to see if the cmd file returns any errors.
Does anyone know a way I can do this? (Preferably without using third party software).

Send your password to the cmd script as a parameter?
superfletch (15th August 2008)

You mean you're not passing the user's password as a parameter, you're getting AutoIt to "type" it in as input to your batch file? Surely there has to be a better way - can't you make the batch file take a password as a parameter, test it from the command line, then run it from AutoIt when you've got it working? You could also redirect the output of whatever program you're running from your batch file to a log file of some kind (i.e. put > log.txt 2>&1 at the end of the batch file line you use to run whatever command you're using).
--
David Hicks
Thanks folks,
What it currently does is assign the password as a variable from the AutoIt GUI, then uses send(the variable) to type it into the cmd file.
What you're saying is to stick with that but get AutoIt to pass the password as a variable into a parameter within the batch file, perhaps using the filewriteline command?

I think you just want the _RunDos command, you just need to run the batch file from the command prompt a couple of times to check if it works before running it from AutoIt - either that or redirect the command's output with "> out.log 2>&1".
It would probably help if you gave us a few more details of what, exactly, you're trying to do.
--
David Hicks
superfletch (19th August 2008)
Thanks dhicks,
_RunDos has worked now - It took me quite a while to get it there though, I kept missing bits of my commands. It's also a lot neater than calling the cmd file as I don't have the dirty old Dos window appearing!!
There are currently 1 users browsing this thread. (0 members and 1 guests)