Start / Stop a Windows Service from a non-Administrator user account

Below I have put together everything I learned about Starting/Stopping a Windows Service from a non-Admin user account, if anyone needs to know. Primarily, there are two ways in which to Start / Stop a Windows Service. 1. Directly accessing the service through logon Windows user account. 2. Accessing the service through IIS using Network … Read more

Install Windows Service created in Visual Studio

You need to open the Service.cs file in the designer, right click it and choose the menu-option “Add Installer”. It won’t install right out of the box… you need to create the installer class first. Some reference on service installer: How to: Add Installers to Your Service Application Quite old… but this is what I … Read more

How to install node.js as windows service?

Late to the party, but node-windows will do the trick too. It also has system logging built in. There is an API to create scripts from code, i.e. var Service = require(‘node-windows’).Service; // Create a new service object var svc = new Service({ name:’Hello World’, description: ‘The nodejs.org example web server.’, script: ‘C:\\path\\to\\helloworld.js’ }); // … Read more

Elevating process privilege programmatically?

You can indicate the new process should be started with elevated permissions by setting the Verb property of your startInfo object to ‘runas’, as follows: startInfo.Verb = “runas”; This will cause Windows to behave as if the process has been started from Explorer with the “Run as Administrator” menu command. This does mean the UAC … Read more

Install a .NET windows service without InstallUtil.exe

Yes, that is fully possible (i.e. I do exactly this); you just need to reference the right dll (System.ServiceProcess.dll) and add an installer class… Here’s an example: [RunInstaller(true)] public sealed class MyServiceInstallerProcess : ServiceProcessInstaller { public MyServiceInstallerProcess() { this.Account = ServiceAccount.NetworkService; } } [RunInstaller(true)] public sealed class MyServiceInstaller : ServiceInstaller { public MyServiceInstaller() { this.Description … Read more

How to create an installer for a .net Windows Service using Visual Studio

In the service project do the following: In the solution explorer double click your services .cs file. It should bring up a screen that is all gray and talks about dragging stuff from the toolbox. Then right click on the gray area and select add installer. This will add an installer project file to your … Read more

When creating a service with sc.exe how to pass in context parameters?

sc create <servicename> binpath= “<pathtobinaryexecutable>” [option1] [option2] [optionN] The trick is to leave a space after the = in your create statement, and also to use ” ” for anything containing special characters or spaces. It is advisable to specify a Display Name for the service as well as setting the start setting to auto … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)