Current location - Loan Platform Complete Network - Big data management - c# windows service installs and uninstalls services written by itself via bat files
c# windows service installs and uninstalls services written by itself via bat files
Install: program name + /install or program name + /service

Start: net start + service name or sc start + service name

Stop: net stop + service name or sc stop + service name

Uninstall: sc delete + service name or program name + /uninstall

Example: AA.exe (service name: AA) in the root directory of C drive. uninstall

Example: The BAT for AA.exe (service name: AA) in the root directory of the C drive is as follows:

C:\\aa /install

sc start aa

sc stop aa

c:\aa /uninstall