Install Windows Service in Windows 7

I use the code to install Service in XP:

@"%windir%\Microsoft.NET\Framework\v2.0.50727\Path +@ "\service.exe 

But on Windows 7, this code is a problem

+4
source share
3 answers

On Windows 7, you need to run the command line as an administrator for this to work.

To do this, press the "Start" button, type "cmd" as usual, but instead of pressing Enter, hold CTRL + SHIFT together, then press Enter. A dialog box will appear, confirm it, and you will get administrative access, and the installation should work as expected.

+4
source

I usually use the installutil.exe -i myAppExe command to install. Can you use this command?

+2
source

Only an elevated process (not enough to log on as a member of the Administrators group) can install the service. If you do this from the command line, make it raised (right-click on the shortcut and select "Run as administrator", as well as the instructions of the @Shadow Wizard). If you do this in code, you will need the application to enhance.

0
source

All Articles