Check if a Windows service exists and delete in PowerShell

You can use WMI or other tools for this since there is no Remove-Service cmdlet until Powershell 6.0 (See Remove-Service doc) For example: $service = Get-WmiObject -Class Win32_Service -Filter “Name=”servicename”” $service.delete() Or with the sc.exe tool: sc.exe delete ServiceName Finally, if you do have access to PowerShell 6.0: Remove-Service -Name ServiceName

How to uninstall a Windows Service when there is no executable for it left on the system?

You should be able to uninstall it using sc.exe (I think it is included in the Windows Resource Kit) by running the following in an “administrator” command prompt: sc.exe delete <service name> where <service name> is the name of the service itself as you see it in the service management console, not of the exe. … Read more

How can I verify if a Windows Service is running

I guess something like this would work: Add System.ServiceProcess to your project references (It’s on the .NET tab). using System.ServiceProcess; ServiceController sc = new ServiceController(SERVICENAME); switch (sc.Status) { case ServiceControllerStatus.Running: return “Running”; case ServiceControllerStatus.Stopped: return “Stopped”; case ServiceControllerStatus.Paused: return “Paused”; case ServiceControllerStatus.StopPending: return “Stopping”; case ServiceControllerStatus.StartPending: return “Starting”; default: return “Status Changing”; } Edit: There … Read more

How can I run MongoDB as a Windows service?

After trying for several hours, I finally did it. Make sure: you added the <MONGODB_PATH>\bin directory to the system variable PATH run command prompt as administrator Steps: step 1: execute this command: D:\mongodb\bin>mongod –remove Step 2: execute this command after opening command prompt as administrator: D:\mongodb\bin>mongod –dbpath=D:\mongodb –logpath=D:\mongodb\log.txt –install NOTE: you can also append –serviceName … Read more

What are the specific differences between .msi and setup.exe file?

An MSI is a Windows Installer database. Windows Installer (a service installed with Windows) uses this to install software on your system (i.e. copy files, set registry values, etc…). A setup.exe may either be a bootstrapper or a non-msi installer. A non-msi installer will extract the installation resources from itself and manage their installation directly. … Read more

Map a network drive to be used by a service

Use this at your own risk. (I have tested it on XP and Server 2008 x64 R2) For this hack you will need SysinternalsSuite by Mark Russinovich: Step one: Open an elevated cmd.exe prompt (Run as administrator) Step two: Elevate again to root using PSExec.exe: Navigate to the folder containing SysinternalsSuite and execute the following … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)