Solved

pendrive usb fl hardware more info

Posted on 2013-06-26
3
471 Views
Last Modified: 2013-12-03
Hi Experts,

Can you help?
I'm not sure about those:

1 - I guess simpler.
Need Delphi solution to know Device usb memory stick space left free total in bytes-hardware (Not Volume which is logical value dependable on formatting etc)

2 - Not sure
Wonder also if that is possible to check s/n number for usb dongle memory ( pendrive) with Delphi simply which will work on all Windows OS


Use new XE Delphi.
0
Comment
Question by:johnnyex
  • 2
3 Comments
 
LVL 25

Accepted Solution

by:
Sinisa Vuk earned 500 total points
ID: 39280767
- for usb space: mount/list all volumes of same phisical drive (usb)
http://stackoverflow.com/questions/4645162/how-to-mount-partitions-from-usb-drives-in-windows-using-delphi
... and sum all free bytes...
http://www.delphibasics.co.uk/RTL.asp?Name=DiskFree

- for usb serial number go to my answer to similar question:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28140731.html

... Magenta Systems WMI can help you too.
0
 

Author Comment

by:johnnyex
ID: 39289920
sorry again, confused so which solution is best?
here we can see:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_28140731.html#a39203803

There we can see two methods:
http://stackoverflow.com/questions/4292395/how-to-get-manufacturer-serial-number-of-an-usb-flash-drive


Where author says: "UPDATE
Some drivers of the USB disks does not expose the manufacturer serial number on the Win32_DiskDrive.SerialNumber property, so on this cases you can extract the serial number from the PnPDeviceID property."

So which one is the best method which will work on all drives or maybe use two hybrid if one fail?

Would be good to have one solid solution which will just work is this from first link I posted or second method from stackoverflow link?
0
 
LVL 25

Expert Comment

by:Sinisa Vuk
ID: 39292269
As you said - you can use hybrid method, bu I think that is second (on update) method better.
//note if you have multiple volumes on usb then your serial is: <serial>/<index of partition>
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now