So I'm trying to find a command to uninstall apache from windows that I have installed earlier with an NSIS script.
Basically apache is part of a package of aplications we use for our program, and when uninstalling our program we uninstall them all. Already working for postgres, java and ruby, but I'm not finding any command for apache.
I tried the wmic command, but it required user to confirm the action. There isn't any httpd uninstall command?
httpd -k uninstall
simply removes the service.
Thanks
This question is related to
windows
apache
nsis
uninstallation
sc delete Apache2.4
Remove service in windows
If Apache was installed using NSIS installer it should have left an uninstaller. You should search inside Apache installation directory for executable named unistaller.exe
or something like that. NSIS uninstallers support /S
flag by default for silent uninstall. So you can run something like "C:\Program Files\<Apache installation dir here>\uninstaller.exe" /S
From NSIS documentation:
3.2.1 Common Options
/NCRC disables the CRC check, unless CRCCheck force was used in the script. /S runs the installer or uninstaller silently. See section 4.12 for more information. /D sets the default installation directory ($INSTDIR), overriding InstallDir and InstallDirRegKey. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces. Only absolute paths are supported.
On Windows 8.1 I had to run cmd.exe as administrator (even though I was logged in as admin). Otherwise I got an error when trying to execute: httpd.exe -k uninstall
Error: C:\Program Files\Apache\bin>(OS 5)Access is denied. : AH00373: Apache2.4: OpenS ervice failed
Try this :
sc delete Apache2.4
or try this :
C:\Apache24\bin>httpd -k uninstall
hope this will be helpful
I've had this sort of problem.....
The solve: cmd
/ powershell
run as ADMINISTRATOR! I always forget.
Notice: In powershell
, you need to put .\
for example:
.\httpd -k shutdown .\httpd -k stop .\httpd -k uninstall
Result: Removing the apache2.4
service The Apache2.4
service has been removed successfully.
Source: Stackoverflow.com