Using the Pscp.exe in Putty, Windows can be scripted to upload files to Linux, but Pscp.exe first run must manually enter the confirmation information, this article mainly resolves the first run of human interaction, completely realize silent operation. This program can be used in many Task scheduler
error message: The server ' s host key is not a cached in the registry. You have no guarantee, the server is the computer your think it is.
Solution:
1. Create a new text file, enter Y and then wrap
For example: Confirm.txt:
Y< blank line >
2. Enter Y as a file redirection at the end of the Pscp.exe command, as shown in the following example:
< Confirm.txt
Description, redirect the input ' < ' to redirect text content as input to the PSCP command, and automatically answer prompts when running PSCP
3 Below is an example of my own, for reference only
:: Set Run time set datevar=%date: ~0,4%%date: ~5,2%%date: ~8,2%:: Start running PSCP and redirect the input C:\vminfo\PSCP as a file . Exe-q-PW X33+esac c:\vminfo\test\runningtask* [email protected]:/vminfo/< C:\VMInfo\test\confirm. Bat :: Print Log Echo "##### #EndTime--%datevar%:%time%########" >> c:\VMInfo\test\Running1.log
Reference:
Http://www.sqlservercentral.com/Forums/Topic281954-9-3.aspx
Batch processing (BAT) obtains textual content using set p and redirect input branches
The server ' s host key is not cached in the registry. You have no guarantee the server ...