scripting@wanadoo.nl




GetServiceStartup()

http://www.scriptlogic.com/kixtart/FunctionLibrary_FunctionList.aspx


actual FunctionLibrary list on 'Scriptlogic' site printer-friendly mirror of UDF topic on 'scripting@wanadoo.nl' site close
25 March 2002 GetServiceStartup()
AuthorScriptLogic Corporation
Action Returns the startup state of any service, given its 'short' name.
SyntaxGetServiceStartup ("servicename") 
Parameters
  • servicename (Required / String) The 'short' name of the service to check. 
  • RemarksThis function is only supported on the NT-family of products, (NT/2000/XP, etc.)
    You must call this function with the 'short' name of the service, not the 'display / long' name.

    This function returns the startup state of the service, not the current state. 
    ReturnsReturns the service startup state. Possible return values include: 'Boot', 'System', 'Automatic', 'Manual', 'Disabled', or 'Not Installed' 
    Examples
    $result = GetServiceStartup("browser")
    ? 'The Computer Browser Service is set to: '+$result
    
     
    Source
    FUNCTION GetServiceStartup ($shortname)
      ; Author: ScriptLogic Corporation
      DIM $rc,$key
      IF @inwin=1 ; only supported on NT family
        $key='HKLM\System\CurrentControlSet\Services\'+$shortname
        IF KeyExist($key)
          $rc=ReadValue($key,'Start')
          SELECT
          CASE $rc=0
            $getservicestartup='Boot'
          CASE $rc=1
            $getservicestartup='System'
          CASE $rc=2
            $getservicestartup='Automatic'
          CASE $rc=3
            $getservicestartup='Manual'
          CASE $rc=4
            $getservicestartup='Disabled'
          CASE 1
            $getservicestartup='Unknown'
          ENDSELECT
        ELSE
          $getservicestartup='Not Installed'
        ENDIF
      ELSE
        $getservicestartup=''
      ENDIF
    ENDFUNCTION ; - GetServiceStartup -
     
      original source of UDF topic. show actual FunctionLibrary list on Scriptlogic site close top
              printer-friendly mirror of UDF topic on scripting@wanadoo.nl site  




    Copyright © 2003 www.scriptlogic.com & scripting@wanadoo.nl - last updated on 20 May 2003


    Site Meter