Rexec command in Windows
(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:
- Summary of 20 common Run commands on Windows operating system
- Summary of shortcuts to know in Windows 10
- Basic Linux commands everyone needs to know
- Table summarizes the basic PowerShell commands
You should read it
- Del command in Windows
- Set command in Windows
- Cmd command in Windows
- Command at in Windows
- Fc command in Windows
- The echo command in Windows
- Bitsadmin getdisplayname and bitsadmin geterror command in Windows
- The command reg add in Windows
- Rem command in Windows
- Reg command copy in Windows
- Doskey command in Windows
- Exit command in Windows
Maybe you are interested
What to do when open command window here does not appear?
How to switch users on the Linux command line
How to fix Mac Homebrew error 'zsh: command not found: brew'
What is the Command key on Windows?
How to use read command in Linux
Basic Linux commands everyone needs to know - Operations on Linux are much faster