Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am trying to execute the BATCH in remote system with the following code

ManagementBaseObject objInManagementBaseObject = objManagementClass.GetMethodParameters("Create");

objInManagementBaseObject["CommandLine"] = "cmd /c " + "@" + batFileName;

ManagementBaseObject objOutParamsManagementBaseObject = objManagementClass.InvokeMethod("Create", objInManagementBaseObject, objInvokeMethodOptions);
uint ProcessId = (uint)objOutParamsManagementBaseObject["processId"];

It is working fine. But i want to execute the same with "Administrator" privileges.

I don't want to do like ProcessStartInfo.Verbs="runas";

Please help me.
Posted
Comments
Richard MacCutchan 3-Sep-15 3:20am    
You first need to be granted those privileges on the remote system.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900