Search This Blog

Showing posts with label Administration. Show all posts
Showing posts with label Administration. Show all posts

Monday, May 14, 2012

Install a service – windows server 2008

Edit
  1. Run Regedit or Regedt32.
  2. Find the registry entry “HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services”.
  3. Look for the service there and right click on the properties which you want to modify.
Delete
  1. Run Regedit or Regedt32.
  2. Find the registry entry “HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services”.
  3. Look for the service there and delete it. You can look at the keys to know what files the service was using and delete them as well (if necessary).
Install (via command prompt)
  1. At a command prompt, type: installutil <Path of the Service>
Examples:
  • for .net v1.1:
    C:\> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\InstallUtil.exe C:\MyService.exe
  • for .net v2.0: 
    C:\>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe C:\MyService.exe
Install (via bat file – .net v2.0 example)
  1. Save the example code as a bat file.
  2. Place the bat file in the same folder as your service exe file.
  3. Run the bat file.
@echo off
echo Starting installation..
pause
REM SET LOGFILENAME=log_%DATE:~4,2%%DATE:~7,2%%DATE:~10,4%_%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%.txt
REM date /t >> %LOGFILENAME%
REM time /t >> %LOGFILENAME%
REM pause
echo Current directory..
cd
pause
cls
echo YourServiceName in
cd
pause
C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe YourServiceName.exe
pause
cls
echo Installation completed..
pause