none
Have doubt RRS feed

  • Question

  • Hi all

    This would be silly!!!!
    i could not get it, thats why i am reaching you guys.

    I am executing the below command in wmiexplorer and WBEMTEST as query but its not working if i use the LESS THAN condition

    This is working as the driver version is available in my machine

    select * from win32_pnpsigneddriver where devicename like '%graphic%' and DriverVersion = "20.19.15.5060"

    I want to get the driverversion list which is less than 20.19.15.5060,  so when i use the below condition and its not working

    select * from win32_pnpsigneddriver where devicename like '%graphic%' and DriverVersion < "20.19.15.5060"

    i need a query to get the driver version which is less than 20.19.15.5060 version


    THANKS SURESH M

    • Moved by Bill_Stewart Wednesday, September 4, 2019 6:36 PM Abandoned
    Friday, March 15, 2019 1:38 PM

All replies

  • You cannot use a string in a <> comparison.  Strings cannot be compared that way.


    \_(ツ)_/

    Friday, March 15, 2019 1:47 PM
  • Thanks for your response

    But its works for me.
    Is there any difference between these queries.

    select * from Win32_LogicalDisk where DeviceID = "C:" and freespace > "5242880"


    THANKS SURESH M

    Friday, March 15, 2019 1:59 PM
  • Actually you can compare strings with < and >, but it is very rarely useful. They are compared lexicographically (as strings left to right). So "9" is always greater than "3000", for example. You would need to split the string by periods into an array, convert to integers, then compare each element until you decide which version is greater or less. If the first elements are the same, compare the second, etc.

    Richard Mueller - MVP Enterprise Mobility (Identity and Access)


    Friday, March 15, 2019 2:06 PM
  • Thanks for your response

    But its works for me.
    Is there any difference between these queries.

    select * from Win32_LogicalDisk where DeviceID = "C:" and freespace > "5242880"


    THANKS SURESH M

    You can write this like this but the correct way is like this:

    select *from Win32_LogicalDisk where DeviceID = "C:" andfreespace > 5242880

    We don't use quotes around integers.  In this case WMI converts the string to an integer before the comparison so the quotes won't cause an issue.


    \_(ツ)_/

    Friday, March 15, 2019 2:09 PM