Command line parameters work in one machine not another

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

Command line parameters work in one machine not another

Post by kpassaur » Thu Jan 06, 2005 12:26 am

I have written a script that processes tif images into text searchable tif images using Microsofts Document Imaging OCR engine. It works fine on my laptop and my desktop. The line that runs the program is as follows


Run Program>C:\Program Files\Common Files\Microsoft Shared\MSPaper\mspview.exe %s% "%fname%"

However On another machine the program mspview is stored in this folder

C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE

When I change the path in Macro Scheduler and run it it fails.

However the following command works from the Start/Run Box

"C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" -f "C:\testit\AGCL 004502.TIF"

I have tried all the syntax changes I can think of - any suggestions? Does anyone have MSPVIEW.EXE installed in the C:\Program Files\Common Files\Microsoft Shared\MODI\11.0 subdirectory?

Microsoft put it their on an XP installation and put it under C:\Program Files\Common Files\Microsoft Shared\MSPaper\ in another installation

Any ideas would be helpful - spent hours on this one

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Thu Jan 06, 2005 12:33 am

Can i see the whole script? Or the part that your having problems with.

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

The part that works

Post by kpassaur » Thu Jan 06, 2005 12:39 am

This is the part of the program that works - I have isolated to the command line by creating six separate one line marco that fail


/////////////////////////////////////Get rid of non tif file
Position>tif,%fname%,1,ftype
/MDL>%ftype%
If>%ftype%=0,testtype
Let>RP_WAIT=1
/Run Program>C:\Program Files\Common Files\Microsoft Shared\MSPaper\mspview.exe %s% "%fname%"
Run Program>%pp% %s% "%fname%"
Let>RP_WAIT=0
WriteLn>C:\TextSearchTiffs\log.txt,%fname%
If>r=5,please
Label>registered
Let>r=r+1
Label>testtype
Until>k,file_names_count

Some of the Marcros that have failed are:

Let>fname=C:\testit\test.TIF
//test2 Run Program> C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE -f "%fname%"
//test3 Run Program> C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE -f C:\testit\test.TIF
//test4 Run Program> "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" -f C:\testit\test.TIF
//test5 Run Program> "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" "-f" "C:\testit\test.TIF"
Run Program> "C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE -f C:\testit\test.TIF"

Any ideas?

Mark Gevry
Pro Scripter
Posts: 63
Joined: Sat Dec 25, 2004 3:23 pm

Post by Mark Gevry » Thu Jan 06, 2005 12:53 am

So what your saying is, your programs some where else, you transfered them into some folder...and its not working from the script. But its working when you go to start - run - and the directory...? Let me look at the script for a few minutes..

I think there is some error in the script, if its working when you do the 'run' thing. I will let support or Bob hansen to answer this. Give them about 1-3 hours.

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

My poor communication

Post by kpassaur » Thu Jan 06, 2005 1:12 am

Okay I admit it I am poor at communication. Hopefully this wil clarify it. In office XP a program called mspview.exe exists. The above script works with this program with no difficulties.

However if you have Office 2003 it includes a newer version of mspview.exe which is stored in a different location; the newer accepts the same command line parameters as the old verison. If you just change the file path, the script does not work even though the same parameters apply.

It makes no sense to me at all as when I use the Start/Run command I can get program to run. So, I believe it is a syntax error. But what is wrong I cannot figure out. I need someone who has Office 2003 with Microsoft Document Imaging to take a command line from the Start / Run box, place it in a script with the Run Program Command from Macro Scheduler and get it to work properly. That I think would do the trick.

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu Jan 06, 2005 7:21 am

Hi Mark,

Please try:
Run>C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE -f C:\testit\test.TIF

Happy scripting.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Jan 06, 2005 7:51 am

You should do this:

Run Program>"C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" -f "%fname%"

The path has spaces in it so put quotes around it. Also check whether mspview needs to be run in a particular directory. If so change directory to that folder first:

ChangeDirectory>C:\Program Files\Common Files\Microsoft Shared\MODI\11.0
Run Program>"C:\Program Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" -f "%fname%"
MJT Net Support
[email protected]

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

This did it

Post by kpassaur » Thu Jan 06, 2005 8:02 pm

It now works - I don't understand why it works with no " " in the command line on one version and with that version if you include them it dosen't work. Regardless, it is up and working. Thank you all

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