views:

8

answers:

0

I want to create a service that takes some parameters. How do I do this with WMI?

In the commandline, it was

sc create ServiceName binPath= ""C:\Path\Service.exe\" /Service somefile1.xml somefile2.xml" start=auto DisplayName="DisplayName"

I have tried to use

ManagementBaseObject inParams = managementClass.GetMethodParameters("create");
inParams["CommandLine"] = ""C:\Path\Service.exe\" somefile1.xml somefile2.xml"
inParams["StartMode"] = StartMode.Auto;
inParasm["DisplayName"] = "displayName";

but I do not know how to pass the two xml files?

Any help will be greatly appreciated.

Thanks! JB