Sign in to follow this  
Followers 0
Neoborn

How To List Drives And Get Label As Well...

3 posts in this topic

Hi Guys,

I was attempting to list the drives in my system and was looking at the tutorial / example script from the helpfile.

CODE

$var = DriveGetDrive( "all" )

If NOT @error Then

MsgBox(4096,"", "Found " & $var[0] & " drives")

For $i = 1 to $var[0]

MsgBox(4096,"Drive " & $i, $var[$i])

Next

EndIf

What this does is return an array with each drive that is attached. I would then like to take each array and use the DriveGetLabel() feature and show it in the msg box but am new to this so am unsure how to proceed.

Any suggestions. I would prefer not a complete "here's the code" but rather you need to do this and here's a hint smile.gif

Thanks.


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
Share on other sites



In this part:

For $i = 1 to $var[0]
MsgBox(4096,"Drive " & $i, $var[$i])
Next

Simply change the msgbox to include the labels.

For $i = 1 to $var[0]
MsgBox(4096,"Drive " & $i, $var[$i] & @CRLF & "label = " & DriveGetLabel ($var[$i]))
Next

Share this post


Link to post
Share on other sites

You rock dood ty vm.


~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Share this post


Link to post
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
Sign in to follow this  
Followers 0