PDA

View Full Version : Newbie (File.Run)



Blue
01-31-2004, 08:49 PM
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
01-31-2004, 08:55 PM
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 (http://www.indigorose.com/webhelp/ams50/Program_Reference/Variables/Global_Variables.htm)

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 (http://www.indigorose.com/webhelp/ams50/Scripting_Guide/Variables.htm)

3) Here's a good link on File.Run() including examples: Click Here (http://www.indigorose.com/webhelp/ams50/Program_Reference/Actions/File.Run.htm)

Hope that helps. :)

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Blue
02-01-2004, 09:15 AM
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.

Corey
02-01-2004, 03:44 PM
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 (http://www.indigorose.com)

Blue
02-02-2004, 01:57 PM
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);

Blue
02-02-2004, 05:10 PM
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:\.)

Brett
02-02-2004, 06:31 PM
Use _SourceFolder instead of _SourceDrive if that is what you are trying to accomplish.