Skip to content

WINRS Windows Command Guide

The Windows winrs command allows users to remotely execute commands on a Windows computer. This command is useful for system administrators who need to perform tasks on multiple machines simultaneously or troubleshoot issues on remote computers. By using winrs, administrators can streamline their workflow and increase efficiency when managing Windows systems. This guide provides a detailed explanation of how to use the winrs command, including syntax and options.

Terminal window
winrs [command] [options] [parameters]
OptionDescription
-rSpecify the target remote computer by name or IP address.
-uSpecify the user name to use for the connection.
-pSpecify the password to use when connecting to the remote computer.
-adUse the Authenticated Device authentication protocol.
-negotiateUse the Negotiate authentication protocol.
-basicUse the Basic authentication protocol.
-kerberosUse the Kerberos authentication protocol.
ParameterDescription
commandThe command to be run on the remote computer.
optionsAdditional options for the command.
parametersAdditional parameters for the command.
Terminal window
winrs -r:REMOTE-COMPUTERipconfig /all

This command runs the “ipconfig /all” command on a remote computer named REMOTE-COMPUTER.

Terminal window
winrs -r:REMOTE-PC “netsh interface show interface”

Use this command to view the network interfaces configuration on a remote PC named REMOTE-PC.

Retrieve System Information from a Remote Computer

Section titled “Retrieve System Information from a Remote Computer”
Terminal window
winrs -r:REMOTE-SERVER "systeminfo"

This command retrieves detailed system information from a remote server named REMOTE-SERVER using the systeminfo command.

Terminal window
winrs -r:SERVER-NAMEshutdown /r /t 0

Restart a remote server named SERVER-NAME by issuing a shutdown command with parameters for an immediate restart.

Terminal window
winrs -r:REMOTE-PC “sc query”

Use this command to query all services on a remote PC named REMOTE-PC.

Run a PowerShell Script on a Remote Computer

Section titled “Run a PowerShell Script on a Remote Computer”
Terminal window
winrs -r:REMOTE-DEVICEpowershell -command Get-Process

This command executes a PowerShell script to get information about processes running on a remote device named REMOTE-DEVICE.

Terminal window
winrs -r:REMOTE-SERVER "get-eventlog System -newest 50"

Retrieve and display the 50 most recent entries from the System event log on a remote server named REMOTE-SERVER.

To use the winrs command in Windows, execute the following command:

Terminal window
winrs --r:remote_computer dir

The winrs command in Windows is used to execute commands on a remote computer.

How can I specify the remote computer when using winrs in Windows?

Section titled “How can I specify the remote computer when using winrs in Windows?”

To specify the remote computer when using winrs in Windows, use the “—r” option followed by the name or IP address of the remote computer.

Terminal window
winrs --r:192.168.0.1 ipconfig

Can I run PowerShell commands with winrs in Windows?

Section titled “Can I run PowerShell commands with winrs in Windows?”

Yes, you can run PowerShell commands with winrs in Windows by specifying the PowerShell executable along with the command.

Terminal window
winrs --r:remote_computer powershell -command "Get-Process"

Is it possible to customize the winrs output format in Windows?

Section titled “Is it possible to customize the winrs output format in Windows?”

Yes, you can customize the winrs output format in Windows by using different options or parameters available with the command you are executing on the remote computer.

How can I troubleshoot connectivity issues when using winrs in Windows?

Section titled “How can I troubleshoot connectivity issues when using winrs in Windows?”

To troubleshoot connectivity issues when using winrs in Windows, ensure that the remote computer is reachable over the network and that the necessary firewall rules are configured to allow communication between the local and remote systems.

  1. Running commands on remote computers
  2. Managing services on remote computers
  3. Managing processes on remote computers
  4. Running scripts on remote computers
  5. Gathering information from remote computers