How to execute a Windows command on a remote PC?

2019-03-08 05:54发布

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?

标签: windows cmd
4条回答
The star\"
2楼-- · 2019-03-08 06:10
psexec \\RemoteComputer cmd.exe

or use ssh or TeamViewer or RemoteDesktop!

查看更多
可以哭但决不认输i
3楼-- · 2019-03-08 06:16

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

winrs -r:PCNAME cmd

This will open a remote command shell.

查看更多
何必那么认真
4楼-- · 2019-03-08 06:21

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.
查看更多
ゆ 、 Hurt°
5楼-- · 2019-03-08 06:26

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

查看更多
登录 后发表回答