Rexec command in Windows

(Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2)

(Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2).

To run commands on remote computers or non-Windows computers . computers running Windows Server 2003, Windows XP, and Windows 2000 operating systems can use the rexec command tool to connect to computers that are not Windows but available as well as running Rexec service (daemon). The rexec command will authenticate the username on the remote computer before executing a specified command. If used without parameters, rexec displays help.

Note: You cannot connect to a computer that is running Windows Server 2003, Windows XP, and Windows 2000 by using the rexec command because the Windows operating system does not provide the Rexec service.

Rexec command syntax

 rexec [Host] [-lUserName] [-n] [Command] 

Rexec command parameter

Parameters

Describe

Host

Specify the remote server (computer) to run the command via name or IP address.

-l UserName

Specify the username on the remote computer. If this parameter is omitted, the name of the user currently logged into the system will be used by default.

-n

Redirect the input of the rexec command to the NUL device. This will prevent the display of command results on the local computer.

Command

Specify the command to run on the remote computer.

/?

Show help at the command prompt

Note the rexec command

Standard for executing orders:

The rexec command prompts the user to enter the password and authenticate the password provided on the remote computer.If authentication is successful, the command will be executed.

The Rexec command copies the standard input to the remote command (remote command), copies the standard output of the remote command to its standard, and copies the standard error of the remote command for the standard error of it. The rexec command will usually exit when the remote command is canceled.

Use navigation symbols:

In order for the redirection to be carried out on the remote computer, you must attach the redirect symbols in quotation marks (eg ">>").If you do not use quotation marks, the redirection will occur on the local computer.For example, the following command appends the remote RemoteFile file data to LocalFile file on the local computer:

 rexec othercomputer cat remotefile >> localfile 

The following command appends the RemoteFile file data to the OtherRemoteFile file on the remote computer:

 rexec othercomputer cat remotefile ">>" otherremotefile 

Use interactive commands:

You cannot run the most interactive commands.For example, vi or emacs commands cannot be run by rexec . However, you can still use the telnet command.

This command will only be available if the Internet Protocol (TCP / IP) protocol is installed as a component in the properties of the network adapter in Network Connections.

Example of the rexec command

To execute the telcon command on the remote computer vax1 by admin1 name, type:

 rexec vax1 -l admin1 telcon 

Annotation format

Format

Meaning

Italicized

Information that users will have to provide.

Bold

The elements that the user is forced to enter are exactly as shown.

Ellipsis (.)

Parameters can be repeated many times in a command line.

Between brackets ([])

Optional components

odd}

Set of options in which the user can only select one.

 Courier font 

Program code or output.

See more:

  1. Summary of 20 common Run commands on Windows operating system
  2. Summary of shortcuts to know in Windows 10
  3. Basic Linux commands everyone needs to know
  4. Table summarizes the basic PowerShell commands
3.9 ★ | 36 Vote