I haven't done something like this for a while, back in the day I did this 
with ScriptIt. But with VBscript or PowerShell it shouldn't be that 
difficult. My guess is that it's losing focus of the window after the 
carriage return. So your method will need to identify the window and the 
password field. 

Take a look at this and see if it helps.

http://csharpening.net/?p=1008



Christopher Bodnar 
Enterprise Architect I, Corporate Office of Technology:Enterprise 
Architecture and Engineering Services 
Tel 610-807-6459 
3900 Burgess Place, Bethlehem, PA 18017 
[email protected] 




The Guardian Life Insurance Company of America

www.guardianlife.com 







From:   David Lum <[email protected]>
To:     "NT System Admin Issues" <[email protected]>
Date:   04/17/2013 04:25 PM
Subject:        Can you do this with .CMD?



Use a batch file to launch an application and then send two carriage 
returns to this app? I can do one, but not two. Running the program is 
asks for username (hitting ENTER it uses a default, which is desired), 
then when you hit <CR> it asks for a password.
 
My batch file looks like this:
programtorun < c:\windows\temp\answerfile.txt
 
Answerfile.txt contains 
<carriage return>
Password <carriage return>
 
The app runs but sits and waits for the password, so it’s only 
processesing the first <CR>. Surely this is a simple one? Some pipe 
command? Maybe I should get out my old DOS 5.0 book…
 
Please, no PoSh because I have tons of XP machines that need to run this…
David Lum 
Sr. Systems Engineer // NWEATM
Office 503.548.5229 // Cell (voice/text) 503.267.9764
 
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin


-----------------------------------------
This message, and any attachments to it, may contain information
that is privileged, confidential, and exempt from disclosure under
applicable law.  If the reader of this message is not the intended
recipient, you are notified that any use, dissemination,
distribution, copying, or communication of this message is strictly
prohibited.  If you have received this message in error, please
notify the sender immediately by return e-mail and delete the
message and any attachments.  Thank you.
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

<<image/jpeg>>

Reply via email to