Tag: services

Microsoft Windows

Install and Uninstall Windows Services

Install your service C:WindowsMicrosoft.NETFrameworkv2.0.50727InstallUtil.exe yourservice.exeC:WindowsMicrosoft.NETFrameworkv2.0.50727InstallUtil.exe yourservice.exe Uninstall your service C:WindowsMicrosoft.NETFrameworkv2.0.50727InstallUtil.exe /u yourservice.exeC:WindowsMicrosoft.NETFrameworkv2.0.50727InstallUtil.exe /u yourservice.exe

C#

Get system services with C#

To list system services, we are going to use ServiceController class. Add a reference to System.ServiceProcess namespace first. try { foreach (System.ServiceProcess.ServiceController s in System.ServiceProcess.ServiceController.GetServices()) Console.WriteLine(s.Status + " — " + s.ServiceName); } catch (Exception) { //… }try { foreach (System.ServiceProcess.ServiceController s in System.ServiceProcess.ServiceController.GetServices()) Console.WriteLine(s.Status + " — " + s.ServiceName); } catch (Exception) { …

Microsoft Windows

Start or Stop Windows Service using batch file

Start Windows Service Open notepad and create a new file named for ex start_my_service.bat. Paste in file the following lines: @echo off echo "starting my_service" net start "my_service" echo "done" @echo on   pause@echo off echo "starting my_service" net start "my_service" echo "done" @echo on pause Save the file, right click on it and select …

NMAP

Identifying the version number of running services

If you wish to identify the software Version (-sV flag) of services running on machine’s open ports, just provide the -sV flag to nmap. Type the command: nmap -sV x.x.x.x where x.x.x.x is the ip address that you wish to scan.   You will get an answer similar to this: Starting Nmap 5.21 ( http://nmap.org …