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
May be interested
- Instructions for using Command Promptdeep in windows is a command-line world that is obscure. in this article, we will show you how to solve errors and make your computer more secure.
- Rd command in Windowsthe rd command helps delete a directory
- Cmd command in Windowsthe cmd command starts a new version of the command interpreter, cmd.exe. if used without parameters, cmd will display copyright information and the version of the operating system.
- How to use the command history function in Command Promptcommand prompt is an extremely familiar command for anyone using windows operating system. besides, a lot of current software also supports the command line to perform actions on the command prompt window, instead of on the screen.
- The sfc command in Windows(applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012)
- Reg command copy in Windowsto copy an entry to the location specified on the local pc or the remote computer we will use the reg copy command. to learn more about how to use the reg copy command, you can track the syntax, explain the command parameters and the example tipsmake.com has compiled below.
- Fc command in Windowsthe fc command compares two files or a collection of files and displays the differences between them.
- The echo command in Windowsthe echo command displays the message or turns on / off the command repeat feature. if used without parameters, the echo command will display the current echo setting.
- Xcopy command in Windowsthe xcopy command is a command prompt command used to copy one or more files or folders from one location to another. with many options and the ability to copy entire directories, the xcopy command is similar to, but much more powerful, than the copy command.
- The cacls command in Windowsthe cacls command displays or modifies an arbitrary access control list (dacl) on the specified file. the command applies to windows server (semi-annual channel), windows server 2016, windows server 2012 r2, windows server 2012.