Board logo

标题: [转载代码] [PowerShell每日技巧]查看已知的USB驱动器(20131205) [打印本页]

作者: DAIC    时间: 2013-12-6 09:15     标题: [PowerShell每日技巧]查看已知的USB驱动器(20131205)

Did you know that Windows maintains a list of all USB storage devices ever hooked up to your machine? And it's simple to dump that list:

$Path = 'HKLM:\SYSTEM\CurrentControlSet\Enum\USBSTOR\*\*'
Get-ItemProperty -Path $Path |
  Select-Object -Property FriendlyName, CompatibleIDs, Mfg

The result will look similar to this:

FriendlyName                      CompatibleIDs                    Mfg
------------                      -------------                    ---
HUAWEI Mass Storage USB Device    {USBSTOR\CdRom, USBSTOR\RAW}     @cdrom.inf,%genmanufacturer%;...
TENDYRON U-DISK USB Device        {USBSTOR\CdRom, USBSTOR\RAW}     @cdrom.inf,%genmanufacturer%;...
General USB Flash Disk USB Device {USBSTOR\Disk, USBSTOR\RAW}      @disk.inf,%genmanufacturer%;(...
Generic External USB Device       {USBSTOR\Disk, USBSTOR\RAW}      @disk.inf,%genmanufacturer%;(...
Ithink B52USB3.0 USB Device       {USBSTOR\Disk, USBSTOR\RAW}      @disk.inf,%genmanufacturer%;(...
Kingston DT CNY 13 Snake USB D... {USBSTOR\Disk, USBSTOR\RAW}      @disk.inf,%genmanufacturer%;(...
SanDisk Cruzer Blade USB Device   {USBSTOR\Disk, USBSTOR\RAW}      @disk.inf,%genmanufacturer%;(...
Ut165 USB2FlashStorage USB Device {USBSTOR\Disk, USBSTOR\RAW}      @disk.inf,%genmanufacturer%;(...


The longer the list, the more different USB storage device contacts did your computer have.

http://powershell.com/cs/blogs/tips/archive/2013/12/05/finding-known-usb-drives.aspx
作者: ludongwang    时间: 2013-12-6 15:00

呀,全英文的这是,是个挑战。
作者: DAIC    时间: 2013-12-6 21:22

回复 2# ludongwang


    好好学英文。好处大大滴




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2