I am attempting to create a batch file that runs an exe. When the exe starts, I am prompted for a password. Can I script it to enter in the password? This is something I need to do daily, so it would be very nice if it could be automated. Any guidance would be greatly appreciated.
best,
bell
help - prompt for password
Moderator: DosItHelp
Re: help - prompt for password
If the exe reads the password off its "standard input stream" you may try "echo yourpassword| yourexe". However, if it's reading it directly off the interactive console, or if it's a GUI app with no console whatsoever, that won't work.
And, just saying, but I wouldn't hardcode a plaintext password in a batch file.
Liviu
And, just saying, but I wouldn't hardcode a plaintext password in a batch file.
Liviu
Re: help - prompt for password
thanks, but it didn't work There has to be a way to automate this! I will keep looking around.
Re: help - prompt for password
'
Maybe $ParamRAW
If that don't work, you are out of luck, that is using DOS
Interface the GUI http://www.autoitscript.com/site/autoit/
I won't advise vbscript, GUI interaction is insecure ( risk of misses ).
Maybe $ParamRAW
Code: Select all
my.exe -h
my.exe -help
my.exe -?
my.exe /?
my.exe ...I forget...
Interface the GUI http://www.autoitscript.com/site/autoit/
Code: Select all
SleepTiming_ReSet ()
While 1
;
SleepTiming_Go ()
$Title = $ParTitle
$Text = $ParText
If WinExists ( $Title, $Text ) Then ExitLoop
;
$Title = 'Internet Explorer'
$Text = 'Internet Explorer is momenteel niet de standaardbrowser.'
If WinExists ( $Title, $Text ) _
And WinActivate ( $Title, $Text ) _
And ControlFocus ( $Title, $Text, 'Button2' ) _
And ControlClick ( $Title, $Text, 'Button2' ) _
Then WinWaitClose ( $Title, $Text )
WEnd
-
- Expert
- Posts: 442
- Joined: 01 Aug 2010 17:13
- Location: Canadian Pacific
- Contact:
Re: help - prompt for password
Answered the same question a number of times recently: viewtopic.php?f=3&t=2677&p=12235#p12235