已答复 query for drivers

全部回复

  • 2006年10月16日 15:44
    所有者:
     
     已答复

    Hi,

    I'm not sure what you expect to find by searching for "dir", I don't find anything on any of my boxes with that. If you meant "dri" you will mostly get a list of the driver types:

    TYPE               : 1  KERNEL_DRIVER
    TYPE               : 2  FILE_SYSTEM_DRIVER

    unless the service or display name includes the word "driver", and many of them don't. SC.exe doesn't identify them as drivers in the output:

    SERVICE_NAME: Ntfs
    DISPLAY_NAME: Ntfs
            TYPE               : 2  FILE_SYSTEM_DRIVER
            STATE              : 4  RUNNING
                                    (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN))
            WIN32_EXIT_CODE    : 0  (0x0)
            SERVICE_EXIT_CODE  : 0  (0x0)
            CHECKPOINT         : 0x0
            WAIT_HINT          : 0x0

    other then on the type line, which is why I recommended using they type= option to filter the list down to just the drivers.

    Note that SC is very particular about the syntax, you need to use the following spacing:

    sc query type= driver

    Hope that helps,

    Andrew

  • 2006年10月18日 13:46
     
     

    dir - i meant dri of course, that's mistake.

    and the result - with spacing provided by you it works. THX! i was typing 'type = driver' and 'type=driver'. did not even thing that it could be important.

    there are two thing i still do not quite understand:

    why 'sc query' do not return all the results [that's why 'find' did not grepped results] and why this command is so fragile for spacing - that's a new feature for MS (;

  • 2006年10月18日 16:23
    所有者:
     
     

    Hi,

    Glad to hear it is working now.

    SC query defaults to just services, not everything so that is why it wasn't listing drivers.

    SC is very specific about its syntax and has been that way since it was first created. I don't own the tool, so not sure why it hasn't been fixed.

    Andrew