ActiveXperts Network Component Add network capabilities to any Windows or .NET application


Network Component - Scp Object

Scp (Secure Copy Protocol) is a way to securely transfer files between two computers using the SSH (Secure SHell) protocol.

The Secure Copy Protocol is the secure analog of the old UNIX RCP command. It is implemented as a part of the SSH system, which means that an SCP client can be used to copy to any file or files to or from a host which has an SSH server running and which has the SCP service enabled.

An SCP client can only be used to copy files. To list the contents of a remote directory or to query for remote file information either SSH or SFTP would be required. In most applications the SCP protocol is considered to be superseded by the more advanced SFTP protocol. However, in some implementations copying a file using an SCP implementation can have a performance advantage.

The Network Component SCP implementation is based on the PuTTY SCP implementation.

The Scp object is part of the Network Component. Overview of all Network Component objects:

DnsServer & DnsRecord - Ftp & FtpFile - Http - Icmp - IPtoCountry - Msn - Ntp - Radius - Rsh - Scp - SFtp - Ssh - SnmpManager - SnmpTrapManager - SnmpMibBrowser - Tcp - Tftp - TraceRoute - Udp - Xen - Wake-on-LAN - Xen (Citrix)

Scp Sample code

VBScript sample: copy a file to a remote LINUX machine

Set objScp           = CreateObject("ActiveXperts.Scp")  ' Create an Scp instance
objScp.Host          = ""                    ' Hostname/IP address of LINUX machine
objScp.UserName      = "demo"                            ' Login as 'demo'
objScp.Password      = "topsecret"                       ' Use a password to login
objScp.CopyToRemote "Smalltoken.file", "."               ' Copy the file to the remote location
WScript.Echo "Copy: result = " & objScp.LastError 
If objScp.LastError <> 0 Then
  WScript.Echo "Error: "  & objScp.LastError
  If objScp.ProtocolError <> "" Then
    WScript.Echo "Protocol error: " & objScp.ProtocolError    
  End If
End If
' YES, command has completed
WScript.Echo "Ready."

On, you can find a lot of Network Component samples. These samples are also part of the Network Component installation.