Identify the drive of a program on Windows
08:14 05 Oct 2015

I have a Windows program coded in C++. To get the drive's serial number of the computer's drive, I run "wmic path win32_physicalmedia get SerialNumber" in the program with _popen().

However, the computers that run the program may have many drives, and USB drives also appear in the list.

How can I do to know which of the drives has the program I'm running? Thanks!

c++ wmic serial-number