Can I pass the content of the batch file directly as argument instead of saving it in a batch file and passing the file itself?
My question is the following, instead of using this:
psftp.exe user_name@host_domain -pw user_pw -b example_batch_file.bat
example_batch_file.bat content:
get filename.csv
I would like to use something like this (in one go, not manually opening the console and doing it one after another, its for automatisation purpose):
psftp.exe user_name@host_domain -pw user_pw -get filename.csv
The psftp can read the commands from the standard input.
So you can do:
If you really need one-liner, then:
Though note that psftp also reads answers to its prompts from the standard input. So you will want to add
-batchswitch to disable all prompts and makepsftpautomatically fail instead.