How to execute a Windows command on a remote PC?

前端 未结 4 894
轻奢々
轻奢々 2020-12-04 10:51

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?

相关标签:
4条回答
  • 2020-12-04 11:31

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

    winrs -r:PCNAME cmd
    

    This will open a remote command shell.

    0 讨论(0)
  • 2020-12-04 11:42
    psexec \\RemoteComputer cmd.exe
    

    or use ssh or TeamViewer or RemoteDesktop!

    0 讨论(0)
  • 2020-12-04 11:46

    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

    0 讨论(0)
  • 2020-12-04 11:47

    This can be done by using PsExec which can 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.
    0 讨论(0)
提交回复
热议问题