Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

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).

Posted
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.

 

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

Posted

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?

Posted
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

  • Thanks 1
Posted

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!!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...