Author Topic: Start service and restart as admin  (Read 1197 times)

mabdelouahab

  • Member
  • ***
  • Posts: 366
Start service and restart as admin
« on: April 29, 2016, 02:36:54 AM »
I'm working on completing work with Sql Server, In the meantime I've encountered a problem: How can I make sure that customer service works
And how do I restarted if stoped
Also, This requires that the program must running as administrator
I made this program to make sure that it works well in all conditions
I suggested : "Audiosrv" Windows Audio Service; you can work on any other service.
Code: [Select]
ServiceName EQU BSTR$("Audiosrv") ;Just for test: Windows Audio Service
Also you can choose a .Net version
Code: [Select]
; CLR = 2 For .Net 2/2.5/3/3.5
; CLR = 4 For .Net 4/4.5

__ClrVersion EQU 2 ; 4
« Last Edit: April 29, 2016, 03:59:10 AM by mabdelouahab »

mabdelouahab

  • Member
  • ***
  • Posts: 366
Re: Start service and restart as admin
« Reply #1 on: April 29, 2016, 06:56:06 AM »
If no error occurs, it will be as follows:
The first run:

Quote
The program needs to run As Administrator
Press any key to continue ...

the second run:
Quote

 Audiosrv Service is  Running
 wait for Stop the service
Press any key to continue ...

 Audiosrv Service is Not Running
 wait for running the service
Press any key to continue ...

fearless

  • Member
  • ***
  • Posts: 345
    • LetTheLightIn
fearless

CM690II Case, HX1000 PSU, Asus Z97, Intel i7-4790K, Seidon 120v Cooler, 16GB DDR3, MSI GTX 980TI

www.LetTheLight.in  My Github  Twitter