Set objService = objWMIService.Get("Win32_BaseService")
objService.Create("usb2", "usb test", "c:\usb2.exe",
OWN_PROCESS, NORMAL_ERROR_CONTROL, "Automatic", NOT_INTERACTIVE, null
This always creates Windows service installation pointing to
localsystem
user(due to the null), I want to point to something other than localsystem, different user account & password. How do I point to a different user account when I create installer for Windows services?
I’m assuming you are authoring an MSI using InstallShield based on your tags. You shouldn’t have to write any code. You can define your service using the ServiceInstall table. Create a component with your EXE as the keyfile and then go down under advanced, services and right click to add a new service. Fill out all the attributes and you should be good to go.