How to invoke “Log on as a service Properties” window programmatically? Can I do this using the command line and mmc?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As requested in comments, I have some very simple code that will set the username and password of an already registered service. Naturally this needs to be done at service install time which is when you have elevated rights. The code happens to be in Delphi but it should be trivial to port it to another language. The function calls are all Windows API calls and the documentation can be found in MSDN.
I’m not sure how you are registering your service (you did not say yet) but it’s quite possible that the service registration you are doing is already capable of setting username and password.
If you already happen to be calling
CreateServiceduring install then that is the point at which username and password should be set.