Hi,
Im trying run to very simple wmic command to output the drive letter of the connected USB drive. The command is "wmic logicaldisk where drivetype=2 get deviceid /format:value". The problem is that the output is "DeviceID=X:",
i want the output to show just X: without "DeviceID=". Also, i'm using an MSP software which allows creating variables from WMI queries, i cant figure out the syntax for the above scenario. So based on their online help (below),
my syntax is root\cimv2:Win32_LogicalDisk.... but then what? Using root\cimv2:Win32_LogicalDisk.DriveType[2].DeviceID does not work.
WMI Property - A WMI namespace, class, and property. The format of the specified WMI property isNameSpace:Class.Property. For example, root\cimv2:Win32_OperatingSystem.FreePhysicalMemory. Specify an instance using the following syntax:NameSpace:Class[N].Property where [N] is the instance number. For example,root\cimv2:Win32_OnboardDevice[3].Description. The first instance may be specified with or without specifying the[1] instance number.