Jump to content

Get drive label that was set by autorun.inf file

Recommended Posts

I'm running Windows 7.

I have an autorun.inf file on a removable drive that looks like this:

label=My Drive Label

When I plug in that USB drive and open Windows Explorer, I see that drive properly labeled.

It says "My Drive Label (G:)" next to the drive icon.

However, I can't figure out how to read that label (without reading the ini file, of course).

If I use DriveGetLabel("G:"), it returns the string that is stored when you right-click the drive and select properties and type in a label. I can't figure out how to make it return the label that is displayed in Windows Explorer.

Any ideas?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...