Showing posts with label Windows Service. Show all posts
Showing posts with label Windows Service. Show all posts
Saturday, May 30, 2009
How to UnRegister .NET Windows Service ?
Use the below script to unregister a windows Service.
Step 1: Create a batch file (eg., UnRegister.bat) and put it in the same foler where your windows service executable file resides).
Step 2: Copy the below script and paste it in above "UnRegister.bat" file.
@ECHO OFF
REM The following directory is for .NET 2.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%DOTNETFX2%
echo UnInstalling WindowsService...
echo ---------------------------------------------------
net stop WINDOWS_SERVICE_NAME
InstallUtil /u WINDOWS_SERVICE.EXE
echo ---------------------------------------------------
pause
echo Done.
Step 3: Replace your windows Service executable file with "WINDOWS_SERVICE_NAME" and "WINDOWS_SERVICE.EXE" string.
Step 4: Save -> Exit from the file. Now the batch file is reay to uninstall the windows service. Just double click the "UnRegister.bat" file.
How to Register .NET Windows Service ?
Registering a Windows Service is always a challenge .
I personally prefer to write / use a script. Below is a script which will install a Windows Service and start it once its installed properly. By default it will set the Mode "Automatic When windows OS starts".
Step 1: Create a batch file (eg., Register.bat) and put it in the same foler where your windows service executable file resides).
Step 2: Copy the below script and paste it in above "Register.bat" file.
@ECHO OFF
REM The following directory is for .NET 2.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%DOTNETFX2%
echo Installing WindowsService...
echo ---------------------------------------------------
InstallUtil /i WINDOWS_SERVICE_NAME
net start WINDOWS_SERVICE.EXE
echo ---------------------------------------------------
pause
echo Done.
Step 3: Replace your windows Service executable file with "WINDOWS_SERVICE_NAME" and "WINDOWS_SERVICE.EXE" string.
Step 4: Save -> Exit from the file.
Now the batch file is reay to install the windows service. Just double click the "Register.bat" file.
Isn't it very easy !!!!
I personally prefer to write / use a script. Below is a script which will install a Windows Service and start it once its installed properly. By default it will set the Mode "Automatic When windows OS starts".
Step 1: Create a batch file (eg., Register.bat) and put it in the same foler where your windows service executable file resides).
Step 2: Copy the below script and paste it in above "Register.bat" file.
@ECHO OFF
REM The following directory is for .NET 2.0
set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727
set PATH=%PATH%;%DOTNETFX2%
echo Installing WindowsService...
echo ---------------------------------------------------
InstallUtil /i WINDOWS_SERVICE_NAME
net start WINDOWS_SERVICE.EXE
echo ---------------------------------------------------
pause
echo Done.
Step 3: Replace your windows Service executable file with "WINDOWS_SERVICE_NAME" and "WINDOWS_SERVICE.EXE" string.
Step 4: Save -> Exit from the file.
Now the batch file is reay to install the windows service. Just double click the "Register.bat" file.
Isn't it very easy !!!!
Subscribe to:
Posts (Atom)