Place that executable in this folder:
Code: Select all
C:\Users\<Your User Id>\AppData\Local\Programs\Zeus\zGNU
Code: Select all
pscp -h
Code: Select all
PuTTY Secure Copy client
Release 0.74
Usage: pscp [options] [user@]host:source target
pscp [options] source [source...] [user@]host:target
pscp [options] -ls [user@]host:filespec
Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-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
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for user authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-hostkey aa:bb:cc:...
manually specify a host key (may be repeated)
-batch disable all interactive prompts
-no-sanitise-stderr don't strip control chars from standard error
-proxycmd command
use 'command' as local proxy
-unsafe allow server-side wildcards (DANGEROUS)
-sftp force use of SFTP protocol
-scp force use of SCP protocol
-sshlog file
-sshrawlog file
log protocol details to a file
Code: Select all
pscp file_name user@host:/path/to/whereyouwant/thefile
Code: Select all
--
-- Name: Save File to Remote Host
--
-- Language: Lua Macro
--
-- Description: This macro will uses the pscp.exe tool to copy the current file to a remote host.
--
-- Refer to the sections marked with NOTE: as these will need to be configured to suit.
--
-- The macro can be run direction on an active file using the Macros menu or it can also be bound
-- to a keyboard key combination an run using those keys.
--
-- Finally the macro can be defined as a trigger which means it will run any time a file is saved.
--
-- To configure this macro for all document types, use the Options, Default Document Type menu and
-- attach the macro to the "File Save Prefix" trigger option. (e.g.)
--
-- Options|Default Document Type...|Triggers|File Save Prefix = $zud\zScript\pscp_exec.lua
--
-- With this setting in place the macro will be run for all documents with all file extensions.
--
-- To configure this macro, for a particular document type, use the Options, Trigger Options menu
-- and attach the macro to the "File Save Prefix" trigger option. (e.g.)
--
-- Options|Trigger Options...|File Save Prefix = $zud\zScript\pscp_exec.lua
--
-- With this setting in place the macro will only run for file extensions defined in the General
-- section of the document type.
--
local utils = require "utils"
function key_macro()
-- macro only works for read/write documents.
if (is_read_only() == 1) or (is_document() == 0) then
-- only complain if this is not a trigger
if is_trigger() == 0 then
message("This macro can only be used with a writable document.")
beep()
end
return
end
-- NOTE: The user id and password for user athentication. Note that
-- it's not a good idea to include the password in the script
-- file. A much better option would be to use private/public
-- keys for the authentication.
local userid = "userid"
local password = "password"
-- NOTE: The host address and target folder
local host = "127.0.0.1"
local target_folder = "/test/"
local arguments = ""
-- NOTE: These options can be used to increase or decrease the debug output.
-- arguments = arguments .. "-v" .. " " -- increases the output
arguments = arguments .. "-q -batch" .. " " -- reduces the output
-- NOTE: The are the other pscp.exe command line options
arguments = arguments .. "-scp -p" .. " "
arguments = arguments .. "-pw " .. password .. " "
arguments = arguments .. macro_tag("$F") .. " "
arguments = arguments .. userid .. "@".. host .. ":"
arguments = arguments .. target_folder;
-- NOTE: Use debug flag to help debug the command line
-- utils.DEBUG = 1
local executable = "pscp.exe";
local filename = "" -- NOTE: The filename is passed in as an argument above
local directory = macro_tag("$FDD")
-- NOTE: The pscp.exe is run using a compiler output window which
-- means it will only display an output window only if some
-- output is produced.
utils.run_compiler(executable, filename, directory, arguments, 2)
end
key_macro() -- run the macro