Newbie (File.Run)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Blue
    Forum Member
    • Jan 2004
    • 4

    Newbie (File.Run)

    X:\CDIMAGE.EXE –lLABEL –t31/01/2004,12:00:00 –h –n –m –o –x X:\FOLDER C:\CD.ISO
    (where X is the drive the CD is in)

    I'm experimenting with the Trial version of AutoPlay Media Studio 5.0.

    I'm trying to produce a button to run the above, but I can't get it to work. This is what I've got:

    File.Run("CDIMAGE.EXE", "–lOFFICE11 –t06/20/2003,12:00:00 –h –n –m –o –x %SrcDrv%\OFFICE C:\OFFICE2003.ISO", "", SW_MAXIMIZE, true);

    Can someone tell me what I'm doing wrong?
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

    #2
    Hi. Glad to have you in the forum:

    1) You are using %SrcDrv% which is deprecated in AMS 5.0, for reference on 5.0's Global Variables check out this: Click Here

    2) You need to escape slashes inside quotes in 5.0, i.e. "Autoplay\Docs\" becomes "AutoPlay\\Docs\\" for more on this check out the escape sequences in the String section here: Click Here

    3) Here's a good link on File.Run() including examples: Click Here

    Hope that helps.

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment

    • Blue
      Forum Member
      • Jan 2004
      • 4

      #3
      Thanks for the help, but I still can't get it to work.

      I've changed it to:

      File.Run("CDIMAGE.EXE", "-d -h -n -m {_SourceDrive}\\FOLDER C:\\CD.ISO", "", SW_MAXIMIZE, false);

      (At this rate it would be quicker to write something in vb!)

      This is what I'm trying to run:
      X:\CDIMAGE.EXE -d -h -n -m X:\FOLDER C:\CD.ISO
      (where X is the drive the CD is in)

      Am I using the _SourceDrive variable correctly.

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9745

        #4
        Hi. You can't embed variables in a string, they need to be concatenated, i.e.:

        "-d -h -n -m {_SourceDrive}\\FOLDER C:\\CD.ISO"

        Becomes:

        "-d -h -n -m ".._SourceDrive.."\\FOLDER C:\\CD.ISO"

        Hope that helps...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment

        • Blue
          Forum Member
          • Jan 2004
          • 4

          #5
          Thanks.

          Sorry to be a pain, but I still can't get this to work.

          Now trying:

          File.Run("CDIMAGE.EXE", "-d -h -n -m ".._SourceDrive.."\\FOLDER C:\\CD.ISO", "", SW_MAXIMIZE, false);

          Comment

          • Blue
            Forum Member
            • Jan 2004
            • 4

            #6
            Thanks for the help. I seem to have got it working now. Not sure what I changed though.

            Up until now I've been using Publish to test the menu by creating an ISO and mounting it on a virtual drive.

            However, I have just tried Preview and I noticed that it's not clever enough to cope with the _SourceDrive as if it were being used on a CD. (Instead of referring back to the CD_Root folder it refers back to C:\.)

            Comment

            • Brett
              Indigo Rose Staff Member
              • Jan 2000
              • 2001

              #7
              Use _SourceFolder instead of _SourceDrive if that is what you are trying to accomplish.

              Comment

              Working...
              X