For example, if the host is not known to plink (like if you run it first time on a new machine or under another local account, for example under Task Scheduler), the first line of input will be taken as a response to the host key prompt. If you really want to keep everything in one file (the batch file), you can write commands to psftp standard input, like: ( Once you exit it (like by typing bye), your batch file continues trying to run open command (and others), what Windows shell obviously does not understand. What you are doing atm is that you run psftp without any parameter or commands. Then it's probably cleaner to do all on the command-line: cd "C:\Program Files (x86)\PuTTY"Īnd remove the open, and lines from your script.txt. This can be done on a psftp command line only. While you can specify the username with the open command ( open you cannot specify the password this way. You need to store the psftp script (lines from open to bye) into a separate file and pass that to psftp using -b switch: cd "C:\Program Files (x86)\PuTTY"ĮDIT: For username password: As you cannot use psftp commands in a batch file, for the same reason, you cannot specify the username and the password as psftp commands.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |