# Find path of usb device with VID and PID

**URL:** <https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725>\
**Category:** General\
**Created:** [20 September 2019 15:00 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725 "2019-09-20T15:00:33Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [20 September 2019 15:00 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/1 "2019-09-20T15:00:33Z")

</div>

i have been searching on way to find path of usb. i found out this node

> **[node-red-contrib-usbhid](https://flows.nodered.org/node/node-red-contrib-usbhid)**
>
> A node-hid (USB HID device access library) wrapper for nodered

  
but it requires node v0.8 - v4.x+.  
is there any other way ??

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [20 September 2019 15:02 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/2 "2019-09-20T15:02:18Z")

</div>

> [@hathemi](#):
>
> but it requires node v0.8 - v4.x+.

Have you tried actually installing it? The readme just suggests those are the ranges they prebuild binaries for - so should still be installable (with the appropriate prereqs in place).

---

<div class="post-metadata">

**Author:** ![hathemi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hathemi/32/3792_2.png) [@hathemi](https://discourse.nodered.org/u/hathemi)\
**Post date:** [20 September 2019 15:03 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/3 "2019-09-20T15:03:48Z")

</div>

yes i did have tried to install it and here's what i get

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c06a2d33da8370bfa5898026e32019ebd1999c97.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [20 September 2019 15:06 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/4 "2019-09-20T15:06:28Z")

</div>

I suspect you are missing the necessary build tools to allow it to build on install. As it says in the log you've shown - you'd need to install the Visual Studio build tools.

Aside from that, to answer your original question, I have no idea how you'd do that on Windows. There may be some command you can use the Exec node to run, but that's as much as I can suggest. May be worth exploring that route - how would you do this with just a command prompt window.

---

<div class="post-metadata">

**Author:** ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)\
**Post date:** [21 September 2019 21:45 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/5 "2019-09-21T21:45:57Z")

</div>

I am not aware of a native way in NR - but in powershell it is relatively trivial

> <https://stackoverflow.com/questions/9704328/how-to-find-my-usb-flash-drives-path-with-powershell>

You could therefore call an Exec node to do this and return the result

Craig

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 September 2019 01:20 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/6 "2019-09-22T01:20:08Z")

</div>

You can also use the WMI to get info. There are commands that will query WMI directly or you can execute via PowerShell:

```auto
Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = '2'"

```

Will return the drive details for removable drives.

> **[Viewing Your Drive Information with PowerShell -- Microsoft Certified...](https://mcpmag.com/articles/2018/01/26/view-drive-information-with-powershell.aspx)**
>
> Using Windows Management Instrumentation makes it easy to pull information about the drives on your system or remote systems. Here's how.

To get even more info, try one of the following PowerShell commands:

```auto
(Get-WmiObject -Class Win32_logicaldisk -Filter "DriveType = 2").getrelated('Win32_Volume') | select *   
(Get-WmiObject -Class Win32_volume -Filter "DriveType = 2") | select *

```

You can replace the filter to use the drive letter as well if you like.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 September 2019 03:51 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/7 "2019-09-22T03:51:31Z")

</div>

It isn't I want to hi-jack the thread, but it has tweaked my interest.

I am using a USB thumb drive on a couple of my machines too and have/had a similar problem.

I want to write log files to the USB stick only that if the memory dies, I don't lose the whole lot. Only the USB stick.  
Writing log files is a lot of I/O and could/will wear out the memory. (you know what I mean)  
So _sacrificing_ a USB stick's memory is better than the SD card.

Reading about the node `node-red-contrib-usbhid` I'm confused.

(may I should ask the person who wrote it. . . . . but)

I set a `flow` variable with the path to the USB stick and append the file name.

I'm not running as `root` and can quite happily read/write to the USB stick.

What's the problem this node solves?  
I'm not seeing it.

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [22 September 2019 04:40 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/8 "2019-09-22T04:40:46Z")

</div>

> [@Trying\_to\_learn](#):
>
> So _sacrificing_ a USB stick's memory is better than the SD card.

Well, if you don't have backups it won't make any difference if it's the usb stick or the sd card, as has been said before. You will still lose data.

If you have multiple pi's (which i believe you do) you should set up multiple usb sticks (or ssd etc) (one on each pi), then cross backup all your data. All of which NR can do.

You will then have a fairly well backed up system, along with the backups of your sd cards. 🤔

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [22 September 2019 06:37 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/10 "2019-09-22T06:37:33Z")

</div>

> [@Trying\_to\_learn](#):
>
> Why are you being so cantankerous?

Sorry, didn't know I was.

I was just trying to assist you in developing a good backup routine, something which you haven't seemed willing to implement in the past.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [22 September 2019 07:01 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/11 "2019-09-22T07:01:16Z")

</div>

> [@Trying\_to\_learn](#):
>
> What's the problem this node solves?  
> I'm not seeing it.

This node has nothing to do with USB storage devices. It is for accessing usb hid devices such as mice,.keyboard and joysticks.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [22 September 2019 07:56 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/12 "2019-09-22T07:56:09Z")

</div>

Thanks Nick. I got confused. (Typical for me)

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 September 2019 11:47 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/13 "2019-09-22T11:47:01Z")

</div>

Also, never forget when thinking about backups that all of your backups do you little good if they are all in the same place. Fire/flood/theft/etc will wipe them all out regardless.

You need at least 2 backups in different locations for important data.

---

<div class="post-metadata">

**Author:** ![Bobo](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bobo/32/8401_2.png) [@Bobo](https://discourse.nodered.org/u/Bobo)\
**Post date:** [24 September 2019 03:53 UTC](https://discourse.nodered.org/t/find-path-of-usb-device-with-vid-and-pid/15725/14 "2019-09-24T03:53:39Z")

</div>

> [@TotallyInformation](#):
>
> You need at least 2 backups in different locations for important data.

Thank goodness for Iron Mountain 😉
