

You can also delete an existing service with “ sc delete” followed by the service name (i.e. The “ config” argument edits an existing service, where as the “ create” argument makes a new service from scratch.


Notice two things here, first instead of saying “ sc create” I said “ sc config“, that is because we already had a service named “ MyProgramName” from our previous attempt. We can get around this by making a different program call MyProgram.exe in the binpath configuration.Ĭ:\user>sc config MyProgramName binpath= “cmd.exe /c C:\MyFolder\MyProgram.exe” type= own start= auto DisplayName= “My Sample Program”
How make a program run at startup on windows 10 how to#
The problem we quickly run into is that MyProgram.exe is not aware of how to behave like a service, so the Service Control Manager (SCM) will shut it down shortly after it starts. To specify via SC that a program should run interactively add “ type= interact” in the arguments (note, you can more than one “ type=” statements at a time). Sometimes programs require running interactively with the Desktop, you can modify your service in the Services control panel applet, (or with SC) to reflect that. To register a program as a service you can use the SC.EXE command which should be part of your Windows operating system.Ĭ:\user>sc create MyProgramName binpath= “C:\MyFolder\MyProgram.exe” type= own start= auto DisplayName= “My Sample Program” There are pros and cons to each method, for example Startup group items will not begin until a user has logged on to the system. Other options are to add programs into the registry in places like HKCU\Software\Microsoft\Windows\CurrentVersion\Run and HKLM\Software\Microsoft\Windows\CurrentVersion\Run, or into the “All Users” Startup group folder (C:\Documents and Settings\All Users\Start Menu\Programs\Startup, C:\Users\All Users\Start Menu\Programs\Startup). Components that run automatically with Windows on boot up often establish themselves as a system service.
