Code:
@echo off
echo.
PowerShell ^
$Tot=((Get-CimInstance -ClassName Win32_PointingDevice) ^| Measure-Object).Count; ^
$List=(Get-CimInstance -ClassName Win32_PointingDevice ^| Sort-Object -Property {$_.Description, $_.DeviceID} ^| Format-Table -AutoSize ^
@{L='Description' ;E={;if([string]::IsNullOrWhiteSpace($_.Description)) {'-'} else {$_.Description}}}, ^
@{L='Device ID' ;E={;if([string]::IsNullOrWhiteSpace($_.DeviceID)) {'-'} else {$_.DeviceID}}}, ^
@{L='Pointing Type' ;E={;if([string]::IsNullOrWhiteSpace($_.PointingType)) {'-'} else {$_.PointingType}};A='Right'}, ^
@{L='Manufacturer' ;E={;if([string]::IsNullOrWhiteSpace($_.Manufacturer)) {'-'} else {$_.Manufacturer.Trim('()')}}}, ^
@{L='Driver Filename' ;E={;if([string]::IsNullOrWhiteSpace($_.InfFileName)) {'-'} else {$_.InfFileName}};A='Right'}, ^
@{L='Driver Section' ;E={;if([string]::IsNullOrWhiteSpace($_.InfSection)) {'-'} else {$_.InfSection}}}, ^
@{L='Power Management Supported';E={;if([string]::IsNullOrWhiteSpace($_.PowerManagementSupported)) {'-'} else {$_.PowerManagementSupported}}}, ^
@{L='Status' ;E={;if([string]::IsNullOrWhiteSpace($_.Status)) {'-'} else {$_.Status}};A='Right'} ^| ^
Out-String -Width 1000).Trim("""`r`n"""); ^
if ($List.Length) {Write-Host """`n--- Mice / Touchpad(s) [$Tot] - Sorted by [Description, DeviceID] ---`n`n `n`n$List"""} else ^
{Write-Host """`n--- NO Mice / Touchpad(s) Available ---"""; exit 1; goto :Microphones} >> %Temp%\A.txt
for /f "delims=" %i in (%Temp%\A.txt) do echo. %i
del %Temp%\A.txt
PowerShell ^
$Arr_DeviceInterface=@{1='Other'; 2='Unknown'; 3='Serial'; 4='PS/2'; 5='Infrared'; 6='HP-HIL'; 7='Bus Mouse'; 8='ADB (Apple Desktop Bus)'; 160='Bus Mouse DB-9'; 161='Bus Mouse Micro-DIN'; 162='USB'}; ^
$Tot=((Get-CimInstance -ClassName Win32_PointingDevice) ^| Measure-Object).Count; ^
$List=(Get-CimInstance -ClassName Win32_PointingDevice ^| Sort-Object -Property {$_.Description, $_.DeviceID} ^| Select ^
@{L=' Name' ;E={;if([string]::IsNullOrWhiteSpace($_.Name)) {'-'} else {$_.Name}}}, ^
@{L=' Description ';E={;if([string]::IsNullOrWhiteSpace($_.Description)) {'-'} else {$_.Description}}}, ^
@{L=' PnP Device ID' ;E={;if([string]::IsNullOrWhiteSpace($_.PNPDeviceID)) {'-'} else {$_.PNPDeviceID}}}, ^
@{L=' Manufacturer' ;E={;if([string]::IsNullOrWhiteSpace($_.Manufacturer)) {'-'} else {$_.Manufacturer.Trim('()')}}}, ^
@{L=' Device ID' ;E={;if([string]::IsNullOrWhiteSpace($_.DeviceID)) {'-'} else {$_.DeviceID}}}, ^
@{L=' Install Date' ;E={;if([string]::IsNullOrWhiteSpace($_.InstallDate)) {'-'} else {$_.InstallDate}}}, ^
@{L=' Device Interface' ;E={;if([string]::IsNullOrWhiteSpace($_.DeviceInterface)) {'-'} else {$Arr_DeviceInterface[[int]$_.DeviceInterface]}}}, ^
@{L=' Creation Class Name' ;E={;if([string]::IsNullOrWhiteSpace($_.CreationClassName)) {'-'} else {$_.CreationClassName}}}, ^
@{L=' System Creation Class Name' ;E={;if([string]::IsNullOrWhiteSpace($_.SystemCreationClassName)) {'-'} else {$_.SystemCreationClassName}}}, ^
@{L=' Number Of Buttons' ;E={;if([string]::IsNullOrWhiteSpace($_.NumberOfButtons)) {'-'} else {$_.NumberOfButtons}}}, ^
@{L=' Config Manager User Config' ;E={;if([string]::IsNullOrWhiteSpace($_.ConfigManagerUserConfig)) {'-'} else {$_.ConfigManagerUserConfig}}}, ^
@{L=' Config Manager Error Code' ;E={;if([string]::IsNullOrWhiteSpace($_.ConfigManagerErrorCode)) {'-'} else {$_.ConfigManagerErrorCode}}}, ^
@{L=' Power Management Supported' ;E={;if([string]::IsNullOrWhiteSpace($_.PowerManagementSupported)) {'-'} else {$_.PowerManagementSupported}}}, ^
@{L=' Power Management Capabilities';E={;if([string]::IsNullOrWhiteSpace($_.PowerManagementCapabilities)) {'-'} else {$_.PowerManagementCapabilities}}}, ^
@{L=' Last Error Code' ;E={;if([string]::IsNullOrWhiteSpace($_.LastErrorCode)) {'-'} else {$_.LastErrorCode}}}, ^
@{L=' Error Description' ;E={;if([string]::IsNullOrWhiteSpace($_.ErrorDescription)) {'-'} else {$_.ErrorDescription}}}, ^
@{L=' Error Cleared' ;E={;if([string]::IsNullOrWhiteSpace($_.ErrorCleared)) {'-'} else {$_.ErrorCleared}}}, ^
@{L=' Driver Filename [.inf]' ;E={;if([string]::IsNullOrWhiteSpace($_.InfFileName)) {'-'} else {$_.InfFileName}}}, ^
@{L=' Driver Section [.inf]' ;E={;if([string]::IsNullOrWhiteSpace($_.InfSection)) {'-'} else {$_.InfSection}}}, ^
@{L=' Availability' ;E={;if([string]::IsNullOrWhiteSpace($_.Availability)) {'-'} else {$_.Availability}}}, ^
@{L=' IsLocked' ;E={;if([string]::IsNullOrWhiteSpace($_.IsLocked)) {'-'} else {$_.IsLocked}}}, ^
@{L=' Handedness [Menus Direction]' ;E={;if([string]::IsNullOrWhiteSpace($_.Handedness)) {'-'} else {$_.Handedness}}}, ^
@{L=' Pointing Type' ;E={;if([string]::IsNullOrWhiteSpace($_.PointingType)) {'-'} else {$_.PointingType.ToString() + ' [1=Other, 2=Unknown, 3=Mouse, 4=Track Ball, 5=Track Point, 6=Glide Point, 7=Touch Pad, 8=Touch Screen, 9=Mouse - Optical Sensor]'}}}, ^
@{L=' Resolution' ;E={;if([string]::IsNullOrWhiteSpace($_.Resolution)) {'-'} else {$_.Resolution}}}, ^
@{L=' Double Speed Threshold' ;E={;if([string]::IsNullOrWhiteSpace($_.DoubleSpeedThreshold)) {'-'} else {$_.DoubleSpeedThreshold}}}, ^
@{L=' Quad Speed Threshold' ;E={;if([string]::IsNullOrWhiteSpace($_.QuadSpeedThreshold)) {'-'} else {$_.QuadSpeedThreshold}}}, ^
@{L=' SampleRate' ;E={;if([string]::IsNullOrWhiteSpace($_.SampleRate)) {'-'} else {$_.SampleRate}}}, ^
@{L=' Synch' ;E={;if([string]::IsNullOrWhiteSpace($_.Synch)) {'-'} else {$_.Synch}}}, ^
@{L=' CIM Class' ;E={;if([string]::IsNullOrWhiteSpace($_.CimClass)) {'-'} else {$_.CimClass}}}, ^
@{L=' Status' ;E={;if([string]::IsNullOrWhiteSpace($_.Status)) {'-'} else {$_.Status}}}, ^
@{L=' Status Info' ;E={;if([string]::IsNullOrWhiteSpace($_.StatusInfo)) {'-'} else {$_.StatusInfo.ToString() + ' [1=Other, 2=Unknown, 3=Enabled, 4=Disabled, 5=Not Applicable]'}}} ^| ^
Format-List ^| Out-String -Width 1000).Trim("""`r`n"""); ^
if ($List.Length) {Write-Host """`n --- Mice / Touchpad(s) [$Tot] - Sorted by [Description, DeviceID] ---`n`n$List"""} else {exit 1}
echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit