User Tag List

Results 1 to 7 of 7

Thread: Is there a way to determine the drive letters on a computer?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Is there a way to determine the drive letters on a computer?

    Hey, folks!

    Is there a way to determine the drive letters on a computer? I'd like my MMF2 application, at start-up, to determine all the drive letters on the computer in which it is running.

    Thanks for your help!

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I think the YASO System Object can do this. Oddly, so can the List object - it has a "Load drive list" action, and you can then parse the available drive letters out of it.

  3. #3
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, DavidN! Thanks for the fast reply!

    When I look at the List object, I can't find an expression which would allow me to capture the list of drive letters (which would be produced from the List object's "Load drive list" action). How would I capture that text string?

  4. #4
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Have a look at this simple example:
    http://www.andersriggelsen.dk/clickt...ive-letter.mfa

  5. #5
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, Andos! Thanks for the example file!

    I didn't explain why I need a list of computer drives... I am working on a music player which uses a List View object to list music tracks the end user has selected. One column in this List View object has the complete path to the audio track, and if the end user clicks on that row, a DirectShow object plays that audio track. This functionality works fine.

    However, if the audio track is stored on an external hard drive which is moved from one computer to another, the drive letter may change (even though the directory path on the external hard drive hasn't changed). Then, when the music player tries to play a selected file, the DirectShow object cannot play it because the absolute path to the audio file has been broken from when that audio file was first selected by the end user.

    So, an idea I had to fix this issue was to get a directory list of all drives on the computer, and when the List View object loads the list of audio files, a Fastloop would determine if each audio file in the list still existed. It might work something like this:

    On Fastloop "Verify Files"
    File/Directory Browser object: If (Text from List View object) doesn't exist, then check "c:\"+Middle Substring of (Text from List View object) through end of that string

    On Fastloop "Verify Files"
    File/Directory Browser object: If "C:\"+Middle Substring of (Text from List View object) doesn't exist, then check "D:\"+Middle Substring of (Text from List View object through end of string

    ...And so on, until all drive letters on the computer have been exhausted.

    If the File/Directory Browser object does find that file with a different drive letter, then the application would update the List View object's path.


    So, the long-story of it is that I don't need the ability for the end user to select the drive letter, but rather I need a list of drive letters so I know which letters to substitute in the Fastloop (and so I know how many times to run the Fastloop).

    Any ideas on how I might be able to do this?

    Thanks again for your help!

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To get just the drive letters out of the list object, you could run a fastloop [number of lines in the List object] times, and replace the contents of each line with Mid$([text of List object at row LoopIndex], 2, 1) (or some expression much like that). Then, in your fastloop to verify files, you would loop for each file, trying [text of List object at row LoopIndex] + ":\etc\etc\etc" each time.

    I... could see this whole method becoming rather slow, though, if you have a lot of files to verify. I don't think it's unreasonable to just assume that a file will be found in the same place each time, and just ignore it if it no longer exists...

  7. #7
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro

    Join Date
    May 2010
    Posts
    536
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey, DavidN!

    Actually, my existing application has a more simplified file verification whereby it simply checks if the file exists, and if the file doesn't exist, that line from the List View object is removed. (I might mention that each time a file is added to the music player, the List View object saves the list of files externally; the same external file is imported when the music player is opened. This saves time from having to import the list from a Fastloop.)

    I find that when I swap this external hard drive between computers, the music player can't find files because the computer assigns the external hard drive to different drive locations. So, I'd like to find a solution to this. Does anyone have any suggestions how I might address this issue?

    Thanks!

Similar Threads

  1. Using coordinates to determine location?
    By XStar in forum iOS Export Module Version 2.0
    Replies: 10
    Last Post: 21st February 2013, 10:57 AM
  2. How to determine computer RAM without using The Big Box object?...
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st February 2012, 01:11 PM
  3. Can I determine the domain a user is on?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th October 2011, 01:03 PM
  4. How can I determine if an audio CD is in the bay?
    By RGBreality in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 19th November 2010, 08:23 PM
  5. Best way to determine default browser ?
    By ClickerGuy in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th September 2008, 10:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •