List available drives
Blitz3D Forums/Blitz3D Programming/List available drives
| ||
Hi, How can I list the drives on my system? The NextFile command only works with files and folders, not drives. Any ideas? |
| ||
Hmm .. not sure, maybe like this ?For i = 1 To 26 d$ = Chr$(65 + i) + ":" If FileType(d$) = 2 Then Print d$ Next |
| ||
Hehe, Interesting method.. ;) And it actually works! But only diskdrives and mapped network drives, but not CD/DVDs... Atleast not for me. Any idea why? And are there any other ways do to this? Maybe more...hmm conventional? ;) ps. your code should be "For i = 0 to 25". |
| ||
Oops! Spoke to soon. If I actually put a cd in the drive it works with cd/dvds.. ;) This is perhaps not a perfect way, but I guess I could use this method. But I´d still like to have a more "system function" function to parse through the drives. |
| ||
GetLogicalDrives might be what you want. http://msdn2.microsoft.com/en-us/library/aa364972.aspx There's a lot of related functions in the treeview on the left for volume information, drive names, etc if you want that stuff too. |
| ||
Thanks Gabriel! I´ll see if I can make use of that function. Otherwise I´ll stay with b32s simple and easy method. It´s a shame that this isn´t included within Blitz by default. Even AMOS on the Amiga has this built in! My wishlist for Blitz features and fixes is getting extremely long now... I just hope that the lid won´t pop off... |