Firstly, please excuse my ignorance as I am completely new to scripting.. Here is what I am planning to do
Stop the service
(it would be good if i could check if service exists in the first place, otherwise, it should still continue on with the script correct?)
Check if Win2k or WinXP, Uninstall the service and delete files according to OS type
Install new application
Here is what I have at the moment. Can someone please review and suggest ways of improvement? Many thanks in advance.
@echo off net stop "service name"
Here, I want to check if the service exists, if yes, just go ahead and stop it, else, echo "Service not installed" and go ahead to uninstall_and_install routine, can i do as below?
if ERRORLEVEL 0 GOTO uninstall_and_install IF NOT echo Service not found GOTO uninstall_and_install :uninstall_and_install C: IF NOT EXIST c:\Windows GOTO Win2k cd Windows\system32\ "insert commands to uninstall and install :Win2k cd Winnt\system32\ "insert commands to uninstall and install exit