Hate to sound like a newbie but...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • entrepid316
    Forum Member
    • Jan 2005
    • 3

    Hate to sound like a newbie but...

    I am

    I hate to ask something that has probably been asked a million times over. Any help is greatly appreciated.

    I have checked quite a few threads on how to try to access data from a CDROM drive but am still greatly confused.

    This is how my files are setup.

    CDROM(Root Dir) - under root on cd I have autorun.ini and my menu name.exe
    Database(Folder - The only folder on the CD) (This folder contains 1 .exe file)
    When I launch menu.exe, i have a button that when I click it, I would like it to look in the 'Database' Folder on the cdrom and run the Database.exe file.

    I would like this to be independant of what drive letter the cd-rom is assigned.

    Can someone please post the exact code of what I would need to do this?
    I am not great with code but will do my best to understand.

    Thanks in advance!

    -E316
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3971

    #2
    nResult = File.Run(_SourceDrive.."\\Database\\Database.exe", "", SW_SHOWNORMAL, false)

    Comment

    • entrepid316
      Forum Member
      • Jan 2005
      • 3

      #3
      one more question.. will that code only work if the exe files are added(compressed) within the menu.exe itself? and or is there a way to run the database.exe that is included on the CD without being added to the menu.exe?

      Comment

      • Worm
        Indigo Rose Customer
        • Jul 2002
        • 3971

        #4
        I apologize, but I'm having a tough time following you. Let me try to explain what it *DOES* do.

        After you build your AMS project and burn it to a CD, the variable _SourceDrive is a dynamic variable that is assigned on execution of Autorun.exe. The _SourceDrive variable then contains the drive letter of the CD-ROM that Autorun.exe was executed from.

        Using the variable in a path is simple by joining the strings with ".."

        Scenario:
        You put your disc in your CD-ROM, and the CD-ROM's drive letter is M:

        nResult = File.Run(_SourceDrive.."\\Database\\Database.exe", "", SW_SHOWNORMAL, false)

        would be the same as:

        nResult = File.Run("M:\\Database\\Database.exe", "", SW_SHOWNORMAL, false)

        Comment

        • entrepid316
          Forum Member
          • Jan 2005
          • 3

          #5
          I understand what you are saying.. but when I burn the files to CD and run my menu.exe and click the BUTTON.. it does not load the Database\Database.exe program. Not really sure why not...

          But I will try some stuff and see if I can figure it out.. Thank you for all of your help though you did help me understand quite a bit more.

          -E316

          Comment

          • Worm
            Indigo Rose Customer
            • Jul 2002
            • 3971

            #6
            Are you using a compressed EXE when you publish?

            Comment

            • Sergio_S
              Indigo Rose Customer
              • Oct 2003
              • 179

              #7
              Let me see if I understand your trouble. What you want is just run one .exe file in the CD.

              If that is correct, you only need is to assign an action to the button, on click:

              File.Run("AutoPlay\\Docs\\ar500ptb.exe", "", "", SW_SHOWNORMAL, false);

              Then, publish your project to a hard drive folder giving to the output folder the folder path where your master cd is being built up. An AutoPlay folder will be created in that path and all the files your project need to be run will be placed there.

              Just burn the cd and the project is ready to go.

              To make the menu run the file is simple like that, but I am not really sure that is your doubt.

              I hope this may help you.

              Sergio

              Comment

              Working...
              X