I encountered the same problem this morning.I was trying to copy the contents of a remote directory to a local directorywith pscp.exe, with all the options specified on the command line (i.e.,username, keyfile, etc). The command executed successfully if I entered itdirectly, but it would give an error when it executed as part of a script:
scp: <
file path>:
Cannot create fileI fixed the problem by appending "." (dot) to the destination directorypath.Original command line:pscp.exe <options> "remote.server:/source/
file/path/*" "c:\local\
file\path\"Corrected command line:pscp.exe <options> "remote.server:/source/
file/path/*""c:\local\
file\path\."
Error with pscp on Windows: "Cannot create file"
最新推荐文章于 2021-04-04 18:48:14 发布