Click here to Skip to main content
15,886,693 members
Home / Discussions / C#
   

C#

 
GeneralRe: tableadapter updating! Pin
Isawyouoo8-Feb-16 11:33
Isawyouoo8-Feb-16 11:33 
GeneralRe: tableadapter updating! Pin
Dave Kreskowiak8-Feb-16 16:41
mveDave Kreskowiak8-Feb-16 16:41 
Questionhow can i get this to work in c# Pin
elfenliedtopfan56-Feb-16 13:52
elfenliedtopfan56-Feb-16 13:52 
AnswerRe: how can i get this to work in c# Pin
Dave Kreskowiak6-Feb-16 16:39
mveDave Kreskowiak6-Feb-16 16:39 
AnswerRe: how can i get this to work in c# Pin
BillWoodruff7-Feb-16 2:50
professionalBillWoodruff7-Feb-16 2:50 
GeneralRe: how can i get this to work in c# Pin
Member 117127539-Feb-16 5:36
Member 117127539-Feb-16 5:36 
AnswerRe: how can i get this to work in c# Pin
Gerry Schmitz8-Feb-16 6:16
mveGerry Schmitz8-Feb-16 6:16 
QuestionHow To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev5-Feb-16 10:04
Tej_dev5-Feb-16 10:04 
Hi All,
I am trying to start remote machine process using C# WMI using below code



C#
//ManagementScope Connection To Remote Server.
               Objconnection.EnablePrivileges = true;
               ManagementScope manScope = new ManagementScope(String.Format(@"\\{0}\ROOT\CIMV2", strRemote), Objconnection);
               manScope.Connect();
               Objconnection.EnablePrivileges = true;

               //Below Code Is For Process Level
               objSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_Process");
               opsObserver = new ManagementOperationObserver();
               objSearcher.Scope = manScope;



C#
ManagementPath managementPath = new ManagementPath("Win32_Process");
                                    ManagementClass processClass = new ManagementClass(manScope, managementPath, new ObjectGetOptions());
                                    ManagementBaseObject inParams = processClass.GetMethodParameters("Create");
                                    inParams["CommandLine"] = "fismqsrvC.exe";//Process name
                                    ManagementBaseObject outParams = processClass.InvokeMethod("Create", inParams, null);
                                    uint rtn = System.Convert.ToUInt32(outParams["returnValue"]);
                                    uint processID = System.Convert.ToUInt32(outParams["processId"]);
                                    Console.WriteLine(rtn);
                                    Console.WriteLine(processID);


Above code working correctly for independent processes. But not able to start Process which is Coming Under Particular service. any direction and help appreciated.

Tejendra
AnswerRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Dave Kreskowiak5-Feb-16 11:39
mveDave Kreskowiak5-Feb-16 11:39 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev8-Feb-16 5:10
Tej_dev8-Feb-16 5:10 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Dave Kreskowiak8-Feb-16 8:50
mveDave Kreskowiak8-Feb-16 8:50 
GeneralRe: How To Start Process On Remote Machine which is tied to Particular service using C#.net WMI Pin
Tej_dev8-Feb-16 10:16
Tej_dev8-Feb-16 10:16 
QuestionDoes this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 0:15
Member 120616005-Feb-16 0:15 
AnswerRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 7:16
professionalEddy Vluggen5-Feb-16 7:16 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 7:43
Member 120616005-Feb-16 7:43 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 9:44
professionalEddy Vluggen5-Feb-16 9:44 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 10:12
Member 120616005-Feb-16 10:12 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 11:16
professionalEddy Vluggen5-Feb-16 11:16 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Member 120616005-Feb-16 11:27
Member 120616005-Feb-16 11:27 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Eddy Vluggen5-Feb-16 23:05
professionalEddy Vluggen5-Feb-16 23:05 
QuestionRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Gerry Schmitz5-Feb-16 12:50
mveGerry Schmitz5-Feb-16 12:50 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
PIEBALDconsult5-Feb-16 15:00
mvePIEBALDconsult5-Feb-16 15:00 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Gerry Schmitz5-Feb-16 15:50
mveGerry Schmitz5-Feb-16 15:50 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
PIEBALDconsult5-Feb-16 15:53
mvePIEBALDconsult5-Feb-16 15:53 
GeneralRe: Does this ensure function1 and function2 use my class in thread safe way? Pin
Gerry Schmitz5-Feb-16 16:13
mveGerry Schmitz5-Feb-16 16:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.