A place to put my code ramblings…

To install a web service using the command prompt,

1. start up the command prompt (CMD) with administrator rights.
2. Type “cd c:\windows\framework\microsoft.net\framework\v4.0.3019\installutil.exe [your windows service path the exe]“
3. Press return and thats that!

About these ads

Comments on: "How to install a Windows Service using the command prompt?" (2)

  1. I have an install/uninstall batch file for this:

    Install:

    @ECHO OFF

    set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
    set PATH=%PATH%;%DOTNETFX2%

    echo Installing WindowsService…
    echo —————————————————
    InstallUtil /i MyWindowsService.exe
    echo —————————————————
    echo Done.

    Uninstall:

    @ECHO OFF

    set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v4.0.30319
    set PATH=%PATH%;%DOTNETFX2%

    echo uninstalling WindowsService…
    echo —————————————————
    InstallUtil /u MyWindowsService.exe
    echo —————————————————
    echo Done.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: