PDA

View Full Version : Script Commandline Arguments [CDIMAGE]


HumptyDumpty
09-29-2005, 09:51 PM
Hi Guys,

I am using AMS6 and was wondering if someone could help me out with the correct syntax to get this menu bar action to work correctly.

What I am trying to achieve is to get AMS6 to play nice with cdimage.exe so I can simply make an iso image on the system drive of the users PC, the contents are only a single folder on the DVD.

First line is simply the action for the Menu Bar button

if e_ID == 201 then
result = File.Run("DATA\\CDIMAGE.EXE", /l"DOCS" ..\DOCS C:\DOCS.ISO,"", SW_SHOWNORMAL, false);
end

Now I know this works perfectly on the command line but adapting it so that AMS6 accepts it is proving hard as I do not have a programming background just know simple dos commandline :(

As you probably guessed the folder I am trying to ISO is <DVD>\DOCS and trying to send this to C:\ but if I could find the right variables would use "/system drive/DOCS.ISO" for overall compatiblity.

I had a quick look and it appears to work correctly using a simple batch file to parse the parameters but was hoping to nut this out and use cdimage with arguements if possible its a cleaner end result :)

Thanks for your time,
HumptyDumpty.

JimS
09-30-2005, 06:00 AM
Remember that backslashes and quotations need to be escaped with backslashes.

For more info, check out the User’s Guide, the chapter called Scripting Guide. Especially Delimiting Statements, and Concatenation. :yes


If exactly this code, works as a batch file:

"DATA\\CDIMAGE.EXE" /l"DOCS" ..\DOCS C:\DOCS.ISO


Then I would use this in AMS:

if e_ID == 201 then
result = File.Run("DATA\\CDIMAGE.EXE", “/l\"DOCS\" ..\\DOCS C:\\DOCS.ISO”,"", SW_SHOWNORMAL, false);
end


Or this:

if e_ID == 201 then
result = File.Run(_SourceDrive.."\\DATA\\CDIMAGE.EXE", “/l\"DOCS\" ..\\DOCS C:\\DOCS.ISO”,"", SW_SHOWNORMAL, false);
end


Hope that helps. :)

HumptyDumpty
09-30-2005, 10:54 AM
Hi JimS,

Thanks alot for you comprehensive reply and will look further into it tomrrow as I need to get some rest now :)

I just did a real quick test and both examples fail with syntax errors :wow

Line=6: unexpected symbol near '"

I will start to read the scripting section of the manual tomorrow and hopefully get something from it ;)

A question also, were you referencing from AMS6 or AMS6, as I've picked up in general reading so far for my cause that scripting has changed quite a bit in the latest verison of AMS.

Thanks again for your reply.

JimS
10-01-2005, 03:32 AM
I’m not too surprised that it didn’t work. I think that the bat file I started with is malformed. Could you post the exact code you use in the bat file that works? Then show me which parts you want to substitute a variable(s) for.

I have faith that we’ll figure this out. :)

Actually, the big scripting change for AMS came in changing from version 4 to version 5. The newest version, version 6, uses the same exact scripting engine that version 5 uses. That means any of the version 5 code examples, or other assets, that you find in the forums, can be imported into version 6.

AMS 6 has added new Objects, Actions, and Events. It’s a terrific superset of version 5. :yes

HumptyDumpty
10-01-2005, 07:12 AM
Here is the exact command line required to create a working TEST.ISO with the contents of <CD>\README directory, CDIMAGE.EXE is located in <CD>\DATA\

CDIMAGE.EXE -lREADME ..\README\ C:\TEST.ISO

Here is information from the help, CDIMAGE.EXE /?

Usage: CDIMAGE [options] sourceroot targetfile

I only require the Label option, hence using (either "-" or "/" work)

-l volume label, no spaces (e.g. -lMYLABEL)

I felt that posting all available parameters wasn't necessary but if you feel that you need them I shall post them for you :)

Thanks for the information regarding scripting development throughout the versions of AMS.

By the way, now thinking with hindsight I should have just posted with a working commandline in the first place instead of my fumbled example :o

JimS
10-04-2005, 05:24 AM
I’m sorry that I disappeared for a couple of days. A long time friend happened to pass through town, and I got a bit sidetracked.

Try this:

if e_ID == 201 then
result = File.Run(_SourceDrive.."\\DATA\\CDIMAGE.EXE", "-lREADME ".._SourceDrive.."\\README\\ C:\\TEST.ISO", "", SW_MINIMIZE, false);
end


It worked for me. :)

HumptyDumpty
10-04-2005, 09:48 PM
Its always good to catch up with old friends, I hope your friendship was revitalised with the passing visit.

Your expertise has come through for me JimS, the process works like a charm using that commandline action and I thank you sincerely for the help :D

Regards
Humpty-Dumpty

JimS
10-05-2005, 01:49 AM
No problem, glad to help, and thanks, I did have a fun visit, lots to catch up on. It was a pleasant surprise. :)

By the way, welcome to the forums. It’s a pleasure to have the chance to help you out a little, especially because I noticed that within your first couple of posts, you took the time to help another user. That really is the spirit of these forums, members helping members, when they can. :yes

Corey
10-05-2005, 03:01 AM
Agreed. The real power behind the forum is the stuff you guys contribute. :yes

And of course Desmond's awesome examples... :)

JimS
10-05-2005, 03:41 AM
You have that right Corey. Lately, Desmond has been even more amazing than he normally is. He has really cranked out a ton of super valuable examples lately. Three cheers for Desmond.

Three more cheers for new members that ‘pass it forward’. :yes

Corey
10-05-2005, 04:10 AM
Yep. Desmond's on fire this month. He's ripping up real estate like some sort of real estate ripping machine. And he's cranking out examples like some sort of example cranking machine. Yeah, I got nothing... Arrrr. :o

Seriously though, those examples are the bee's knees. I visit other software forums and the one thing I have *never* seen, from big to small, is someone from the host company taking the time to generate and post a substantial batch of decent quality example files purely for the sake of giving people some free resources to learn with. I'm mighty fond of that notion. Mighty fond indeed. :yes