I have no experience writing batch scripts, but I was wondering if there was a way to install a .NET Windows service using installutil.exe
using such a script, or uninstall the service if it is already installed, ideally with some kind of confirmation that I actually would like to perform the uninstall (e.g. press y to uninstall).
Here are some details:
- The .exe for the service is located in the
C:\Program Files\Data Service
directory - The script should be in the same directory as the .exe for the service
- It would be nice to add a simple line to a log file (we'll call it
program.log
, also in this directory) after the service has been installed - The machine is running Windows Server 2003 with the .NET Framework installed in the default directory
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
If you feel this could be done in a better way it would be nice to hear other suggestions. I could always write a service installer but that is not a priority.