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. Remoting, Sockets, .... [modified]

Remoting, Sockets, .... [modified]

Scheduled Pinned Locked Moved C#
sysadminhelptutorial
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.
  • S Offline
    S Offline
    Saaaaz
    wrote on last edited by
    #1

    Is there someone who could help me with this please What I want to do is that: 1) Execute the server on my machine. 2) Through that server, initialize/execute the clients(.exe) on the client machines(known machine-names/IP addresses). 3) Clients will then start communication with the server. I actually need help with that 2nd step. PsExec looks to be interesting, but I want that step 2 to be done by my server. --------------------------------------------------------------------------------------------- Like for example when I do something like this: Process proc = new Process(); ProcessStartInfo info = new ProcessStartInfo("C:\\client.exe"); proc.Start(); The above will execute the client.exe on my C drive. But I want to execute this file on other machines residing on the same network (LAN). Thanks. Sarfraz. -- modified at 11:27 Tuesday 27th February, 2007 Sarfraz

    O 1 Reply Last reply
    0
    • S Saaaaz

      Is there someone who could help me with this please What I want to do is that: 1) Execute the server on my machine. 2) Through that server, initialize/execute the clients(.exe) on the client machines(known machine-names/IP addresses). 3) Clients will then start communication with the server. I actually need help with that 2nd step. PsExec looks to be interesting, but I want that step 2 to be done by my server. --------------------------------------------------------------------------------------------- Like for example when I do something like this: Process proc = new Process(); ProcessStartInfo info = new ProcessStartInfo("C:\\client.exe"); proc.Start(); The above will execute the client.exe on my C drive. But I want to execute this file on other machines residing on the same network (LAN). Thanks. Sarfraz. -- modified at 11:27 Tuesday 27th February, 2007 Sarfraz

      O Offline
      O Offline
      originSH
      wrote on last edited by
      #2

      Tried looking here on code project? :P http://www.codeproject.com/csharp/run_code_remotely.asp[^]

      S 1 Reply Last reply
      0
      • O originSH

        Tried looking here on code project? :P http://www.codeproject.com/csharp/run_code_remotely.asp[^]

        S Offline
        S Offline
        Saaaaz
        wrote on last edited by
        #3

        This looks like to be some thing that I actually need: ConnectionOptions objConnectionOptions = new ConnectionOptions(); objConnectionOptions.Impersonation = ImpersonationLevel.Impersonate; objConnectionOptions.EnablePrivileges = true; objConnectionOptions.Username = strUserName; objConnectionOptions.Password = strPassword; ManagementScope objManagementScope = new ManagementScope(@"\\remote-machine-name\ROOT\CIMV2", objConnectionOptions); objManagementScope.Connect(); ManagementClass processClassFinal = new ManagementClass(objManagementScope, new ManagementPath("Win32_Process"), null); ManagementBaseObject inParamsFinal = processClassFinal.GetMethodParameters("Create"); inParamsFinal["CommandLine"] = @"\\remote-machine-name\some-directory\someProgram.exe"; ManagementBaseObject outParamsFinal = processClassFinal.InvokeMethod("Create", inParamsFinal, null); But for some reason it does not work and I don't know why??????? outParamsFinal["processId"] returns null, instead of a valid processId. Is there any one who could help me in that.............. Thanks Sarfraz

        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