Scp is not recognized as an internal or external command, operable program or batch file

PuTTY is an open source program that will allow Windows users to connect remotely to CS Linux Machines. Linux and MAC users may also install PuTTY, but they likely already have the ability to connect to and transfer files to and from Linux file servers.

These instructions assume that you are working from a Windows 8 or later laptop or computer.

Download and Install PuTTY

  1. Go to putty.org
  2. Download the 64-bit installer file (.msi)
    Scp is not recognized as an internal or external command, operable program or batch file
  3. Run the installer. If you accept all defaults, PuTTY should now be installed in your C:\Program Files folder. This should also update your Windows PATH environment variable.

Create a practice folder on your Windows machine

  1. Launch a Command Prompt window. You should be in your default users directory.
  2. Create a cs400, programs and project directory on your Windows computer.
  3. md cs400\programs\practice

    Note: This command creates cs400 and programs if they didn't already exist.

Use PuTTY to Secure Copy a file to practice

Linux and MAC terminal windows allow you to secure (encrypted) copy a file to or from another workstation without having to first open a connection. The command to do this from a Linux workstation is the scp command. The operation is called a secure copy. However, Window's Command Prompt app does not include this command. Instead, you can use PuTTY's pscp command to peform a secure copy between your Windows computer and a CS Linux workstation.

Windows Users

  1. Navigate to your Windows practice workspace. C:\users\deppeler> cd cs400\programs\practice
  2. Run this command to copy our HelloWorld.java program to your computer.
  3. pscp :/p/course/cs400-deppeler/public/students/HelloWorld.java .

    Note: the period at the end of the above command. It indicates that you wish to copy the file to the current directory.

MAC and Linux Users

  1. Navigate to your practice workspace. /users/deppeler> cd cs400/programs/practice
  2. Run the scp command scp :/p/course/cs400-deppeler/public/students/HelloWorld.java ~/users/deppeler/cs400/programs/practice

This section describes how to install and configure SCP on Windows, for uploading offline usage data in on-premises isolated network.

On-premises Mode

For uploading usage data for the on-premises mode, SCP is installed as a service on the proxy machine. The SCP service and RMS License Manager need not be installed on the same machine. 

The topics included in this section are:

>Unzip the SCL Add-on Package

>(Optional) Specify the Path of the SCP Configuration File

>Configure SCP

By Editing the SCP Configuration File

By Using SCP Command-line Options

>Install SCP

>Start SCP

Unzip the SCL Add-on Package

Unzip the SCL Add-on package by using the password received in Thales order emails, to extract the Windows-specific package.

(Optional) Specify the Path of the SCP Configuration File

The default path of the SCP configuration file is \Redistributable\SentinelCloudPlugin (same as the SCP service). You can specify a different path for the SCP configuration file by using the SCP_CONFIG_FILEPATH_[vendor_alias] system-level environment variable.

The precedence of options for picking the SCP configuration file is:

>The configuration file path specified in the SCP_CONFIG_FILEPATH_[vendor_alias] system-level environment variable.

>The default configuration file path.

NOTE    

The SCP_CONFIG_FILEPATH_[vendor_alias] environment variable (if defined) has higher precedence than the application directory. The environment variable to pick the configuration file should be set under the system variables for the SCP service to run successfully.

Configure SCP

There are certain settings that you need to configure before installing and running SCP. There are two ways of configuring SCP on Windows:

>By editing the SCP configuration file

>By using the SCP command-line options

By Editing the SCP Configuration File

Open the SCP configuration file and modify the following elements applicable for on-premises deployment mode:

Element

Description

[Mandatory] YPSaddress

Specifies the URL of Directory Services (DS) which is received in emails from Thales.
For example:

https://demo-yps.com/YPServer
[Mandatory] UsageUploadMode

Specify the mode to upload the usage data. For on-premises deployment mode, it should be set to "offline_uploader".

NOTE   After modifying this element in SCP configuration file, execute sntlcloudps_[vendor_alias].exe -start command from the path where the SCP service is placed.

(Optional) LoggingSettings

Specifies the logging settings. By default, logging is enabled in error mode. For details on how to change the logging settings, refer to the section Configure Logging.

(Optional) ProxyMode

Specifies the proxy connection mode. The possible values are:

>1: It indicates that the proxy is disabled.

NOTE   The licensed application will not connect to the cloud if the client machine is in a proxy environment and proxy settings for SCP are not defined.

>2: It refers to the manual proxy mode. In this mode, you need to manually set the proxy settings.

>3: It refers to the auto proxy mode. In this mode, the proxy settings are automatically detected.

For details about the advanced proxy connection mode settings, refer to the section Configure Advanced Proxy Settings.

A Note on Applying Updated SCP Configurations

If the SCP configuration file is updated while SCP is running, the application restart is required to apply the updated settings.

Configure UsageUploadMode

>Open the SCP configuration file and modify the following element:



NOTE   After modifying the SCP configuration file, you need to execute the following command from the path where the SCP service is placed:

sntlcloudps_[vendor_alias].exe -start.

(Optional) Configure Logging

To change the logging settings, open the SCP configuration file and uncomment the LoggingSettings section and change the options as per the requirement. Values of these settings are mentioned in comments in the configuration file itself. For example, if logging needs to be changed from error mode to debug mode, LogLevel can be changed from ‘1’ to ‘2’.

Specify the name and path of the log file in the LogFilePath element.

By default, the log file (.log) is created at the same location where SCP executable is placed.

To configure logging using command-line options, refer to the section SCP Command-line Options.

(Optional) Configure Advanced Proxy Settings

Open the SCP configuration file and modify the following elements:

Element

Description

Manual Proxy Settings (ProxyMode value="2")

ProxyHost

Proxy host name or IP address.

ProxyPort

Port at which proxy is running.

Proxy Credentials (when authentication is enabled in the proxy server)

ProxyUser

User name used for proxy authentication.

ProxyPassword

Proxy password used for proxy authentication.

Auto Proxy Settings (ProxyMode value="3")

In this mode, the proxy settings are automatically detected. There are two automatic proxy detection methods:

>WPAD (Web Proxy Autodiscovery Protocol): In this case, proxy detection can be done by using either DNS or DHCP discovery methods.

NOTE   DHCP has a higher priority than DNS. The WPAD-enabled client first uses DHCP to find a proxy server, and if the desired information is not obtained, DNS is used. If the wpad.dat file is not found or if proxy is not detected while running wpad.dat, no error is returned. Instead the client tries to connect in the manner similar to when the proxy is disabled (No Proxy).

>PAC (Proxy Auto-configuration): In this case, the location of the proxy script file should be specified in the configuration file.

In the auto proxy mode, WPAD has precedence over PAC.

ProxyPAC

Location of the auto-proxy configuration (.pac) file to be used for proxy detection. Use this option in the case of auto-proxy with the .pac file support. This option takes URL or path of the .pac file as input.

To configure proxy settings using command-line options, refer to the section SCP Command-line Options.

Install SCP

NOTE   Please note that Admin privileges are required to perform install/uninstall operations.

By using command-line, navigate to the following directory: \Redistributable\SentinelCloudPlugin .

To install the SCP service, use the following command:

sntlcloudps_[vendor_alias].exe –install

or

sntlcloudps_[vendor_alias].exe -i    

or

sntlcloudps_[vendor_alias].exe -installstart

NOTE    

>The installstart option should be used after the required configurations have been set in the SCP configuration file.  Otherwise, the required configurations (such as, ypsaddress) should be specified as input to the installstart option.

>To start SCP in offline mode, you need to either configure the offline mode in SCP configuration file or execute sntlcloudps_[vendor_alias].exe -is -mode "offline_uploader" command.

Start SCP

>To start SCP:

sntlcloudps_[vendor_alias].exe  -start -mode "offline_uploader"  

or

sntlcloudps_[vendor_alias].exe  -start 

NOTE   The above command is applicable only when OfflineUsageSetting is already uncommented in the SCP configuration file.

>To restart SCP:

sntlcloudps_[vendor_alias].exe  -restart -mode "offline_uploader"  

>To stop SCP:

sntlcloudps_[vendor_alias].exe –stop

>To uninstall SCP:

sntlcloudps_[vendor_alias].exe -remove

or

sntlcloudps_[vendor_alias].exe -r

>To check whether SCP is running or not:

sntlcloudps_[vendor_alias].exe -status

For more details, refer to the section SCP Command-line Options.

How do I enable scp on Windows?

SCP Installation and Configuration on Windows.
>Unzip the SCL Add-on Package..
>(Optional) Specify the Path of the SCP Configuration File..
>Configure SCP..
•By Editing the SCP Configuration File..
•By Using SCP Command-line Options..
>Install SCP..
>Start SCP..

How do you fix is not recognized as an internal or external command operable program or batch file?

You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.

How do I use scp to transfer files from Windows to Linux?

You can use PSCP to copy files from Windows to Linux..
Download PSCP from putty.org..
Open cmd in the directory with pscp.exe file..
Type command pscp source_file user@host:destination_file. Ex. pscp sample.txt [email protected]:/mydata/sample.txt..

How use scp command in Linux with example?

Use SCP when: Copying files from a local host to a remote host. Copying files from a remote host to a local host. ... SCP Command Options..