You have created or installed service that uses Start parameters and now want to change them you would expect to be able to change them in Services (services.msc), but unfortunately changes made to „Start parameters“ cannot be applied from that application. But there are few approaches that can help you quickly to fix this issue. In following examples we will be changing Solr 6.6.2 service that was installed by using NSSM (the Non-Sucking Service Manager)

 

NSSM

If you have just installed your service you can try removing service and adding it again with correct parameters using Command prompt by running following commands (without brackets):

nssm remove {ServiceName}

nssm install {ServiceName} {ServiceLocation} {ServiceParameters}

 

 

If removing and adding service is not an option for you there is also an NSSM „set“ command designed for updating your Services by typing:

nssm set solr662new “AppParameters” “start -f -p 8984”

 

 

 

Registry

Another approach would be using Registry. All services from services.msc are being read from one Registry location: „Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{Service Name}“, and if your service has sub key/folder „Parameters“, expand it and there you can find AppParameters, where you can visually change your „Start parameters“

 

 

 

 

 

C#

In following code we are accessing Registry key „Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services“ and looking for service named „solr662new“, after it is found we are updating DisplayName and AppParameters values. If you need to update values other than AppParameters try checking out  ServiceRegistryDtoModel and ParametersDtoModel models and UpdateRegistryKey method and update it to suit your needs.