How To Create Service On Windows

Windows is really amazing OS, you have cool GUI, full, optimize performance especially for personal PC, it has lot of capabilities that any other OS can't compete with windows. And if you are programmer, windows also support you by providing easiness of program development, like for example when we have a program need to have a service whenever every user log on to their computer. You can create a (.bat) file to be executed when user doing installation.

To create service for experiment purpose, you can run cmd using administration privileges

sc create MyServiceName binpath= "\"C:Program Files (x86)\My Service\yourProgram.exe\" --someparameter=0" displayname= "My Service"

The trick is, always create space after equals sign, and always create double-quotes in your program location. You can add more option, like for the example above we define displayname which will appear as our service name, You can also read more detail about SC command here from official windows documentation.

If succeeded, on cmd you will see a text saying "[SC] createservice success". To even make sure that your service is created, you can check windows services, just search Services.


Comments

Popular posts from this blog

How To Make Sitemap in Blogger

How To Change Facebook Name

How To Zip And Unzip On Ubuntu Terminal