Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

Remotely Start CMD

  • 24-02-2016 06:08PM
    #1
    Registered Users, Registered Users 2 Posts: 6,309 ✭✭✭


    Hi guys,

    Hoping a Windows admin can help me out.
    How can I run cmd prompt on remote machines on my network?

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 11,101 ✭✭✭✭28064212


    So you want to open a command prompt window locally, but the commands run on the remote machine? Download psexec to your local computer and run:
    psexec \\192.168.1.100 cmd
    
    Or if you need to run it as a different user:
    runas /netonly /user:domain\user "psexec \\192.168.1.100 cmd"
    
    There are a couple of caveats, like the fact that tab-completion doesn't work.

    Depends on what you want to do really. I find remote prompts pretty awkward and slow. For example, if you want to start a windows service, you're better off starting a local prompt and running
    sc \\192.168.1.100 start NameOfService
    

    Boardsie Enhancement Suite - a browser extension to make using Boards on desktop a better experience (includes full-width display, keyboard shortcuts, dark mode, and more). Now available through your browser's extension store.

    Firefox: https://addons.mozilla.org/addon/boardsie-enhancement-suite/

    Chrome/Edge/Opera: https://chromewebstore.google.com/detail/boardsie-enhancement-suit/bbgnmnfagihoohjkofdnofcfmkpdmmce



  • Registered Users, Registered Users 2 Posts: 6,309 ✭✭✭T-K-O


    Thank you, tried and tested this morning!


  • Moderators, Arts Moderators, Regional Abroad Moderators, Paid Member Posts: 11,206 Mod ✭✭✭✭Fysh


    T-K-O wrote: »
    Thank you, tried and tested this morning!

    Another option which is more versatile but may also be more work to set up is PowerShell's PSSession.

    Enter-PSSession {fqdn or ip address} will attempt to open the connection; you'll need winrm enabled and possibly firewall rules. But with those configured, you can then do anything for which a cmdlet exists from your local machine. Once you're finished, Exit-PSSession will terminate the session for you.


Advertisement