Jump to content

Recommended Posts

Posted

I didn't think this was going to be a difficult thing to find but I can't even find this in Google searches in any other languages.

I've got a script that copies a lot of data to a USB drive and I just had a user run it on an old computer and it took FOR EVER!!! turns out that computer only has USB 1.1

I want my script to detect if a computer only supports USB v1.1 and i'll throw a warning to the user that it's going to take HOURS to copy.

Closest I found was a VBscript that retrieves information about the USB controller, and another note that says to look for "Enhanced" in the device caption. I'm not a fan of that so I'm wondering if there are any other possibilities.

$objWMIService = ObjGet("winmgmts:\\.\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_USBController");,,48)
If IsObj($colItems) Then
    For $objItem in $colItems
;~      Wscript.Echo "Availability: " & objItem.Availability
        If StringInStr($objItem.Caption, "Enhanced") Then MsgBox(0, "", "Supports USB 2.0")
;~      Wscript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
;~      Wscript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
;~      Wscript.Echo "CreationClassName: " & objItem.CreationClassName
;~      Wscript.Echo "Description: " & objItem.Description
;~      Wscript.Echo "DeviceID: " & objItem.DeviceID
;~      Wscript.Echo "ErrorCleared: " & objItem.ErrorCleared
;~      Wscript.Echo "ErrorDescription: " & objItem.ErrorDescription
;~      Wscript.Echo "InstallDate: " & objItem.InstallDate
;~      Wscript.Echo "LastErrorCode: " & objItem.LastErrorCode
;~      Wscript.Echo "Manufacturer: " & objItem.Manufacturer
;~      Wscript.Echo "MaxNumberControlled: " & objItem.MaxNumberControlled
;~      Wscript.Echo "Name: " & objItem.Name
;~      Wscript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
;~      Wscript.Echo "PowerManagementCapabilities: " & objItem.PowerManagementCapabilities
;~      Wscript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
;~      Wscript.Echo "ProtocolSupported: " & objItem.ProtocolSupported
;~      Wscript.Echo "Status: " & objItem.Status
;~      Wscript.Echo "StatusInfo: " & objItem.StatusInfo
;~      Wscript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
;~      Wscript.Echo "SystemName: " & objItem.SystemName
;~      Wscript.Echo "TimeOfLastReset: " & objItem.TimeOfLastReset
    Next
EndIf

Thanks,

Mike

  • Moderators
Posted

MikeOsdx,

Cannot help with identifying the type progamatically, but as a workaround how about trying to transfer a reasonably sized file on its own first and checking on the time taken? If the time taken is over a certain threshold, then you can warn the user about the possibility of a lo________________ng wait. :blink:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...