Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Run Commands On Other Computers

Run Commands On Other Computers

Scheduled Pinned Locked Moved C#
helpquestioncsharpagentic-aisecurity
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MartyExodus
    wrote on last edited by
    #1

    Hello, I'm asking yet another question to all of you geniuses. I've gotten nearly every function working in the program I'm developing for work. The one thing I'm missing, however, is the ability to run commands on remote computers. At first, I was hoping there was some .NET function to do this easily (you can start and stop services, so why not apps?) However, it does not appear so. Perhaps I missed one. My next guess was to try to start telnet, and try to use SendKeys.Send() to send my commands... however, the commands pass into my Command Prompt before telnet finishes connecting. The actual problem is that i'm hoping for a .NET managed way to run remote commands. A workaround for telnet like that would be usable, but only as a last-hope sort of thing. If possible, perhaps there is a .NET managed way to perform the task without running DOS commands remotely? This is what I'm trying to do:

    //pseudocode:
    RemoteComputer comp = new RemoteComputer("Target");
    comp.Run("wuauclt.exe /resetauthorization");
    comp.Run("wuauclt.exe /detectnow");
    //wuauclt.exe is the Automatic Updates program for Windows.

    I'm simply trying to get the remote computer's Windows Update Agent to reset authorization, and then detect updates. Thanks in advance to any of you who can help.

    C 1 Reply Last reply
    0
    • M MartyExodus

      Hello, I'm asking yet another question to all of you geniuses. I've gotten nearly every function working in the program I'm developing for work. The one thing I'm missing, however, is the ability to run commands on remote computers. At first, I was hoping there was some .NET function to do this easily (you can start and stop services, so why not apps?) However, it does not appear so. Perhaps I missed one. My next guess was to try to start telnet, and try to use SendKeys.Send() to send my commands... however, the commands pass into my Command Prompt before telnet finishes connecting. The actual problem is that i'm hoping for a .NET managed way to run remote commands. A workaround for telnet like that would be usable, but only as a last-hope sort of thing. If possible, perhaps there is a .NET managed way to perform the task without running DOS commands remotely? This is what I'm trying to do:

      //pseudocode:
      RemoteComputer comp = new RemoteComputer("Target");
      comp.Run("wuauclt.exe /resetauthorization");
      comp.Run("wuauclt.exe /detectnow");
      //wuauclt.exe is the Automatic Updates program for Windows.

      I'm simply trying to get the remote computer's Windows Update Agent to reset authorization, and then detect updates. Thanks in advance to any of you who can help.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I suspect you need to have a program installed on the target computer, which you can communicate with.  Otherwise, Windows would have no security at all, right ?

      Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

      M 1 Reply Last reply
      0
      • C Christian Graus

        I suspect you need to have a program installed on the target computer, which you can communicate with.  Otherwise, Windows would have no security at all, right ?

        Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

        M Offline
        M Offline
        MartyExodus
        wrote on last edited by
        #3

        Well, the security is not an issue. Whatever the method I try to utilize, my account has Administrator rights on all of the target computers....... but perhaps I can work on the "Install a Program" idea. Can anyone teach me about making a pushing services? I only know how to Start and Stop them remotely. edit: Actually, i found a great tutorial on how to make basic services. Cool. -- modified at 18:24 Wednesday 17th January, 2007

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups