3 Replies Latest reply on Aug 16, 2006 1:45 AM by jumpOnCommand

    FileIO finding the CDROM drive

    jumpOnCommand Level 1
      Hello, I'm trying to find a users CDRW, or to put it clearer, a certain file from the users CD ROM.

      Im creating an autorun CD, inwhich the director movie will autorun from this CD, and when the user clicks 1 of 5 buttons, it loads an *.exe file and [the movie] closes down.

      I've read this script, and played with the downloadable example, but it all looks very complex. Is this how its done, or is there an easier way to script it when the movie is running on the same drive as the *.exe files?

      http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16280

      Thanks for any help given.

      jumpOnCommand

      CHECK SCRIPT:
      on CheckDrive theFileName
      repeat with i = 67 to 90
      drive = numToChar( i )
      thisPath = drive & ":\" & myCD
      myFile = new(xtra "fileio")
      openFile(myFile,thisPath,1)
      myVariable = readFile(myFile)
      if myVariable<>VOID then
      member("drive").text="file found on drive: "&drive
      alert "The file was found on Drives" &&QUOTE& drive &QUOTE&&". Click 'Get Text' to make sure!"
      exit
      end if
      end repeat
      alert "The file was NOT found on any Drives from C to" && drive&&"."
      end
        • 1. Re: FileIO finding the CDROM drive
          Level 7
          If you are working under the assumptions that the user is on a Windows
          PC and the program you want to launch is on the same CD as your Director
          program, you don't need to go through all that. You can use 'the
          moviePath' so the program knows, at runtime, what it's own path is.

          If the program is called "myProgram.exe" and it is in the same folder as
          the Director movie, then put this on your button:

          on mouseUp me
          open the moviePath&"myProgram.exe"
          halt
          end

          if your 'myProgram.exe' is in a subfolder (in my example, the folder's
          name is 'subfolder') on the disk, then you can do this:

          on mouseUp me
          open the moviePath&"subfolder\myProgram.exe"
          halt
          end

          If you want to know the drive letter that the program is running from,
          this will be it:

          myDriveLetter=(the moviePath).char[1]
          • 2. Re: FileIO finding the CDROM drive
            jumpOnCommand Level 1
            Thank you, I was sure there would be a simplier script. That shuold work great thanks!

            jumpOnCommand
            • 3. Re: FileIO finding the CDROM drive
              jumpOnCommand Level 1
              Thank you, I was sure there would be a simplier script. That shuold work great thanks!

              jumpOnCommand