Issue with Run Program with Command line Application

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Issue with Run Program with Command line Application

Post by kpassaur » Tue Apr 25, 2006 9:40 pm

I have always thought (until today) that whatever you typed on a command line you could copy and paste into MS and use with Run Program. However, for somereason it is not working today.

The following are a couple of bat files that work

bat file one contents
-------------------------------------
Del c:\scrapelos\temp\pages.txt
CD ..\scrapelos\temp\
mbtpdfasm.exe -m\\*.*\.pdf -gHFN >pages.txt
-------------------------------------end of bat file one

bat file two contents
------------------------------------------------------------
Del c:\scrapelos\temp\pages.txt
CD ..\scrapelos\temp\
mbtpdfasm.exe -mJ*.*\.pdf -gHFN >pages.txt
---------------------------------------------------------------


Macro Script File - Does not Work - Have tried numerous paths and combinations


Change Directory>C:\ScrapeLos\Temp
Iffileexists>C:\ScrapeLos\Temp\pages.txt
Deletefile>C:\ScrapeLos\Temp\pages.txt
Endif

Let>RP_Wait=1
Run Program>mbtpdfasm.exe -mJ*.*\.pdf -gHFN >pages.txt

The manual for mbtpdfasm mentions Perl and that is why it I needed the two "\\" before the *.* in the first bat file (it works with it). I found on a web site that you needed to have two \\ if you did not start with a charchter.

Anyway, any ideas on this would be welcome. I already have to create and delete three text files in the script, if would be nice if I didn't have to create and delete a bat file each time it is run as well.

The program being executed, mbtpdfasm.exe is free and it is used for combining PDF files it can be found at

http://thierry.schmit.free.fr/dev/mbtPd ... fAsm2.html

It does other things becides combine pdfs and it would be nice if it could be used in this MS Script file. I have written a few MS Scripts that use this program and cannot seem to figure out why this one won't run. I'm postive (which dosn't mean much) that it is a syntax error and not MS. So, any hints on what to try next?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Apr 25, 2006 9:49 pm

I have not tried this but it might work.
Have you tried:?

Let>RP_Wait=1
Run Program>cmd /c mbtpdfasm.exe -mJ*.*\.pdf -gHFN >pages.txt

Good Luck,
Dick

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

cmd /c fixed run program issue

Post by kpassaur » Tue Apr 25, 2006 10:01 pm

Thanks, that is one thing I didn't try and it appears to be doing the trick.

How do you know when to use cmd /c? Will it also work with 2000 or just XP? Any pointers will save me on the next issue

Thanks again, appreicate it

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Tue Apr 25, 2006 10:08 pm

The "/C" is just a way to pass parameters to the windows command processor, think of it as sending info to a DOS window. Go to a DOS prompt and type in CMD /? and press return. This will tell you more about it.

This works in every windows OS since WinNT. The command processor for Win9x is COMMAND. COMMAND probably has less functionality than CMD but the "/C" will work with it.

Is that clear enough? I'm not an expert on this...

Later,
Dick

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

CMD /c

Post by kpassaur » Tue Apr 25, 2006 10:24 pm

Yes that makes some sense but I was under the assumption that they were going to be passed by MS. I guess it will take further research.

Thanks again

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Apr 26, 2006 1:47 pm

I haven't investigated how I would pass the command line parms, but you, of course could use

Exe>c:\program files\somefile.exe

I tested this quickly with Excel.exe

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts