Home > OS >  Sc. Exe to create Windows Service at the time of the first run, to enter the password again
Sc. Exe to create Windows Service at the time of the first run, to enter the password again

Time:10-12

I made a program that need to be installed inside a Windows service, so I use the ShellExecute call sc. An.exe:

Create myservice statement is as follows:
C:/WINDOWS/system32/sc. Exe create myservice binPath="my. Exe" start=demand obj="mydomain \ kk" password="111"

After execution, can appear in the list of services myservice the service, but can't start it,
Whether language C:/WINDOWS/system32/sc. Exe start myservice or right-click on myservice after click "start" menu, all cannot be started,

I then right-click myservice, click "properties", select "this account", user name, but after input the password again and confirm, whether language sentence or manually start the service, no problem,

But the most strange issue is only on the new machine installation and start the service for the first time, only need to input the password again, once started, no matter how I start/stop service repeatedly, repeatedly install/uninstall the service, are not the problem, and on the WinXP/Windows 7/WIN10 has this problem,

Look is a Windows Bug? Because of the same statement, perform the installation/start the second time, is not the problem, why is this? In theory, Windows should not be so retarded question ah,,, please advise!
  • Related