Need a way to check status of Windows service programmatically

前端 未结 9 1015
走了就别回头了
走了就别回头了 2021-01-04 10:11

Here is the situation:

I have been called upon to work with InstallAnywhere 8, a Java-based installer IDE, of sorts, that allows starting and stopping of windows ser

9条回答
  •  死守一世寂寞
    2021-01-04 10:35

    A shot in the dark but take a look at your Install Anywhere java documentation.

    Specifically,

    /javadoc/com/installshield/wizard/platform/win32/Win32Service.html

    The class:

    com.installshield.wizard.platform.win32
    Interface Win32Service
    
    All Superinterfaces:
        Service 
    

    The method:

    public NTServiceStatus queryNTServiceStatus(String name)
                                         throws ServiceException
    
        Calls the Win32 QueryServiceStatus to retrieve the status of the specified service. See the Win32 documentation for this API for more information.
    
        Parameters:
            name - The internal name of the service. 
        Throws:
            ServiceException
    

提交回复
热议问题