A
A
arakeloff2014-10-30 21:05:55
C++ / C#
arakeloff, 2014-10-30 21:05:55

How to get information about the flash drive from which the program is launched?

The program is launched from a flash drive, you need to find out:
1. The letter of the flash drive;
2. Serial number (the one after Vid and Pid of the device or the entire code);
3. GUID number of the flash drive.
Help, please, who than can.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stanislav Silin, 2014-10-30
@byme

The letter of the flash drive can be obtained immediately from the main parameters:

#include<stdio.h>

int main(int n, char** args)
{
  printf(args[0]);
}

We get the path of the working directory, parsing which we find out the letter.
Then, with the help of WinApi or some other, you can find out everything else.
PS I don’t know yet how to find out the rest, you need to dig

A
Andrey Akimov, 2014-10-31
@Ostan

Alternatively, upload one of the specialized utilities to the USB flash drive, which you can take from the usbdev.ru website. It is possible to find a utility that writes a log, and then read this log through your program. Well, or directly "connect" to the utility for collecting information and receive data from it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question