piping to another command

  • Thread starter Thread starter James
  • Start date Start date
J

James

i have a password.txt file that contain a password, say abc.

I need to run a decryption program and the software requires a passphase.
When manually run the decryption.exe file, it prompts

Enter passphase : <when i type password manually, screen suppose to be
blank, followed by enter>

therefore i thought of piping the password to the program by creating a
batch file

mybatch.bat
=========

decryption.exe | type password.txt

And the screen shows

Enter passphase : abc (and stops here)

When i press enter, it prompts

Enter passphase : <blank and it expects me to type a password>

How shld i pipe out correctly ?
 
James said:
i have a password.txt file that contain a password, say abc.

I need to run a decryption program and the software requires a passphase.
When manually run the decryption.exe file, it prompts

Enter passphase : <when i type password manually, screen suppose to be
blank, followed by enter>

therefore i thought of piping the password to the program by creating a
batch file

mybatch.bat
=========

decryption.exe | type password.txt

And the screen shows

Enter passphase : abc (and stops here)

When i press enter, it prompts

Enter passphase : <blank and it expects me to type a password>

How shld i pipe out correctly ?


Make sure password.txt contains a linefeed (press enter) after the password.

Try one of these:
type password.txt|decryption.exe
decryption.exe<password.txt

For more info, go to Start -> Help and Support and search for "using command
redirection operators".
 
Back
Top