Call for .exe on DVD from the hard drive

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Bruce
    Indigo Rose Customer
    • Jun 2001
    • 2134

    Call for .exe on DVD from the hard drive

    I need to call for an executable within my AMS DVD from the hard drive. I know it's like current_drive or something like that.

    result = File.Run("Current_drive\\autoplay\\myfolder\\setup .exe", "", "", SW_SHOWNORMAL, false);
    Last edited by Bruce; 12-15-2007, 12:18 AM.
  • Mina
    Forum Member
    • Oct 2005
    • 630

    #2
    Originally posted by Bruce View Post
    I need to call for an executable within my AMS DVD from the hard drive. I know it's like current_drive or something like that.

    result = File.Run("Current_drive\\autoplay\\myfolder\\setup .exe", "", "", SW_SHOWNORMAL, false);
    I assume by "current", you mean the same drive that the ams application was run from.
    If so, try this

    Code:
    File.Run(_SourceDrive.."\\autoplay\\myfolder\\setup.exe", "", "", SW_SHOWNORMAL, false);

    Comment

    • Bruce
      Indigo Rose Customer
      • Jun 2001
      • 2134

      #3
      No that didn't work.... hummm any ideas?

      Comment

      • Autoplayit07
        Forum Member
        • Nov 2007
        • 15

        #4
        Code:
        result = File.Run(_SourceDrive.."\\AutoPlay\\myfolder\\setup.exe", "", _SourceDrive.."\\AutoPlay\\myfolder\\", SW_SHOWNORMAL, false);
        Last edited by Autoplayit07; 12-15-2007, 10:50 AM.

        Comment

        • Bruce
          Indigo Rose Customer
          • Jun 2001
          • 2134

          #5
          nah... I'm gonna have to rethink this. Not workin.

          Comment

          • holtgrewe
            Indigo Rose Customer
            • Jul 2002
            • 779

            #6
            Bruce
            You are attempting to access the hard drive on the system from the DVD executable path.
            If you know exactly where it's located on the hard drive, try hard coding the exact path as a debug.
            If that works you should be able to figure out the AMS varaible to use.

            hth
            Last edited by holtgrewe; 12-15-2007, 02:04 PM.

            Comment

            • Bruce
              Indigo Rose Customer
              • Jun 2001
              • 2134

              #7
              No, I'm attempting to access the DVD-Rom from the hard drive. Does that make sense?

              Comment

              • Mina
                Forum Member
                • Oct 2005
                • 630

                #8
                Originally posted by Bruce View Post
                No, I'm attempting to access the DVD-Rom from the hard drive. Does that make sense?
                Hi Bruce,

                I thought the program was run from the same source drive..

                Here, this might help.

                Code:
                -- The name of the DVD 
                DVD_NAME = "The Terminator"
                -------------------
                
                Drives = Drive.Enumerate();
                
                for index, Driv in Drives do
                
                tbINFO = Drive.GetInformation(Driv);
                if tbINFO.Label == DVD_NAME then
                   cDriv = Driv
                end
                end
                
                if cDrive ~= nil then
                result = Dialog.Message("Notice", "DVD Found!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
                
                File.Run(cDrive.."\\autoplay\\myfolder\\setup.exe", "", "", SW_SHOWNORMAL, false);
                else
                -- not found / dvd is not inserted
                result = Dialog.Message("Notice", "Please insert the DVD First", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
                
                end
                Make sure you replace "The Terminator" with your Dvd's name

                Comment

                • Bruce
                  Indigo Rose Customer
                  • Jun 2001
                  • 2134

                  #9
                  Thanks Mina, LOL I sould know this stuff!

                  Comment

                  • Bruce
                    Indigo Rose Customer
                    • Jun 2001
                    • 2134

                    #10
                    I never was much on tables I get: Line 10: attempt to index global "tbINFO' (a nil value)
                    That would be this line: if tbINFO.Label == DVD_NAME then

                    Comment

                    • Mina
                      Forum Member
                      • Oct 2005
                      • 630

                      #11
                      Originally posted by Bruce View Post
                      I never was much on tables I get: Line 10: attempt to index global "tbINFO' (a nil value)
                      That would be this line: if tbINFO.Label == DVD_NAME then
                      Hmmm this one should work
                      (I highlighted my changes in green, and corrected my typos in red)

                      Code:
                      -- The name of the DVD 
                      DVD_NAME = "The Notebook"
                      -------------------
                      
                      Drives = Drive.Enumerate();
                      
                      for index, Driv in Drives do
                      [COLOR="Green"]gTYPE = Drive.GetType(Driv);
                      if gTYPE == 5 then[/COLOR]
                      tbINFO = Drive.GetInformation(Driv);
                      [COLOR="Green"]rLABEL = tbINFO.Label[/COLOR]
                      [COLOR="Green"]if rLABEL == DVD_NAME then[/COLOR]
                         cDriv = Driv
                      end
                      end
                      end
                      if [COLOR="Red"]cDriv[/COLOR] ~= nil then
                      Dialog.Message("Notice", "DVD Found!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
                      File.Run([COLOR="Red"]cDriv[/COLOR].."\\autoplay\\myfolder\\setup.exe", "", "", SW_SHOWNORMAL, false);
                      else
                      -- not found / dvd is not inserted
                      result = Dialog.Message("Notice", "Please insert the DVD First", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
                      
                      end

                      Comment

                      • Bruce
                        Indigo Rose Customer
                        • Jun 2001
                        • 2134

                        #12
                        well it moved around a little bit...
                        onstartup,line 11: attempt to index global 'tbINFO' (a nil value)

                        Comment

                        • Mina
                          Forum Member
                          • Oct 2005
                          • 630

                          #13
                          Originally posted by Bruce View Post
                          well it moved around a little bit...
                          onstartup,line 11: attempt to index global 'tbINFO' (a nil value)
                          That's Odd.
                          It works perfectly fine here.
                          Hmm

                          Maybe someone else has something to say about this?

                          Comment

                          • Bruce
                            Indigo Rose Customer
                            • Jun 2001
                            • 2134

                            #14
                            Really? Send me your project and tell me how your setting up to test it.
                            Thx

                            Comment

                            • Mina
                              Forum Member
                              • Oct 2005
                              • 630

                              #15
                              Originally posted by Bruce View Post
                              Really? Send me your project and tell me how your setting up to test it.
                              Thx
                              Sure Bruce,
                              I don't see how this is going to help tho..
                              Attached Files

                              Comment

                              Working...
                              X