Remoting, Sockets, .... [modified]
-
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
-
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
-
Tried looking here on code project? :P http://www.codeproject.com/csharp/run_code_remotely.asp[^]
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