How to create a service in windows 7 using sc.exe




















Worked fine after re-installing the program but after restart of pc will not work. Your email address will not be published. Save my name, email, and website in this browser for the next time I comment. EXE Posted on April 30, EnumDependEnumerates Service Dependencies.

You may also like How I Do Make it Work? Posted in Windows Services Tagged essential-tools , sc. EXE simos says:. July 20, at pm. Cambridge Knight says:. July 24, at pm. Reinhard says:. December 16, at pm. Are there any alternate methods to this? Your question is therefore not about a specific issue with your code, but about software and off topic for this particular site. You should instead have asked your question on Super User. Add a comment.

Active Oldest Votes. Now create a MyProg. Edit 3 based on comments from CodenameK Apparently you need to compile the SrvStart version with that is compilable with VS to make it run correctly Win CodenameK yes that is natural, any other? Did you try to run the exe file manually? Does it run correctly? CodenameK do you have any log from the application confirming it? If it works when executed under that user then it is probably an issue of user rights. Try to create the service with credentials of that user where it works and not as a LocalSystem did you try to run it under LocalSystem?

CodenameK That is more question for the application programmer, how it should be run as service. It is very hard to guess this when I don't even know that application. For example, we are running one of our legacy applications with a "technical" administration account, which allows the application to have all necessary rights it needs.

CodenameK Ok, I'll edit the answer and show you one more way to do it. Double-click the entry, or right-click and select Event Properties to view the details. After seeing logs in the Event Log , you should stop the service. It's designed to log a random joke once per minute. This is intentional behavior but is not practical for production services. If the service is not in the Stopped state, it will not be immediately deleted.

Ensure that the service is stopped before issuing the delete command. Skip to main content. This browser is no longer supported. Download Microsoft Edge More info.

Contents Exit focus mode. Please rate your experience Yes No. Any additional feedback? Publish a. NET worker app as a single file executable. Create a Windows Service. Create the BackgroundService app as a Windows Service. Start and stop the Windows Service. View event logs. Delete the Windows Service.

Tip All of the "Workers in. Tip If you're using Visual Studio Code, you can run. Note By default, the Event Log severity is Warning. Tip If you need to change the content root of the host configuration , you can pass it as a command-line argument when specifying the binpath : sc.

Tip To configure the recovery options, your terminal session needs to run as an Administrator. But I couldn't access the arguments through the args variable when I run it as a service.

Instead it suggests placing your logic in the OnStart method and then using C Environment. GetCommandLineArgs ;. I couldn't handle the issue with your proposals, at the end with the x86 folder it only worked in power shell windows server using environment variables:. In W Server you still need the space, e. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. When creating a service with sc. Ask Question. Asked 11 years, 4 months ago. Active 6 months ago. Viewed k times. Parameters collection? Do the backslashes need to be escaped i.

Worst thing, you could directly edit the Registry value afterwards if SC. EXE can't do it. I gave up on sc. I used Installutil.



0コメント

  • 1000 / 1000