I'm not much of a DOS expert and need a hand. I am running a dos command called pscp that connects to a remote server to transfer files. This command requires a password to be entered after the command and its parameters has been entered. I am trying to write a DOS batch file that will automate this because I have to run it several times. What do I need to do in the batch to get the password to be sent to the prompt and entered when the prompt requests it. I want it to be done without having to hit anymore keys after the batch is running.
Have ya tried this first? (from PuTTY User Manual. Note red highlighted command-line option.)
5.2 PSCP Usage
Once you've got a console window to type into, you can just type pscp on its own to bring up a usage message. This tells you the version of PSCP you're using, and gives you a brief summary of how to use PSCP:
Z:\owendadmin>pscp
PuTTY Secure Copy client
Release 0.53
Usage: pscp [options] [user@]host:source target
pscp [options] source [source...] [user@]host:target
pscp [options] -ls user@host:filespec
Options:
-p preserve file attributes
-q quiet, don't show statistics
-r copy directories recursively
-v show verbose messages
-load sessname Load settings from saved session
-P port connect to specified port
-l user connect with specified username -pw passw login with specified password
-1 -2 force use of particular SSH protocol version
-C enable compression
-i key private key file for authentication
-batch disable all interactive prompts
-unsafe allow server-side wildcards (DANGEROUS)