How to execute a Windows command on a remote PC?

2019-03-08 06:07发布

问题:

Is it possible to execute a Windows shell command on a remote PC when I know its login name and password? Is it possible to do it using client PC's Windows shell?

回答1:

psexec \\RemoteComputer cmd.exe

or use ssh or TeamViewer or RemoteDesktop!



回答2:

If you are in a domain environment, you can also use:

winrs -r:PCNAME cmd

This will open a remote command shell.



回答3:

You can use native win command:

WMIC /node:ComputerName process call create “cmd.exe /c start.exe”

The WMIC is part of wbem win folder: C:\Windows\System32\wbem



回答4:

This can be done by using PsExec which an be downloaded here

psexec \\computer_name -u username -p password ipconfig

If this isn't working try doing this :-

  1. Open RegEdit on your remote server.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System.

  3. Add a new DWORD value called LocalAccountTokenFilterPolicy

  4. Set its value to 1.
  5. Reboot your remote server.
  6. Try running PSExec again from your local server.


标签: windows cmd