Main Page | Report this Page
Computers Forum Index  »  Computer - Databases - Filemaker  »  start exe with a parameter in scripts...
Page 1 of 1    

start exe with a parameter in scripts...

Author Message
Kees...
Posted: Tue Oct 13, 2009 1:34 pm
Guest
In a script I start a exe with the script step:
URL open "file://c:/program files/myExeDir/myProgram.exe"
This works fine

The new version of myProgram wants a parameter. I'' ve tried:
"file://c:/program files/myExeDir/myProgram.exe myParam" or
"file://c:/program files/myExeDir/myProgram.exe" "myParam"
But both ways fail.

Any ideas?

Greetings,
Kees
 
Howard Schlossberg...
Posted: Tue Oct 13, 2009 11:46 pm
Guest
Kees wrote:
Quote:
In a script I start a exe with the script step:
URL open "file://c:/program files/myExeDir/myProgram.exe"
This works fine

The new version of myProgram wants a parameter. I'' ve tried:
"file://c:/program files/myExeDir/myProgram.exe myParam" or
"file://c:/program files/myExeDir/myProgram.exe" "myParam"
But both ways fail.

The problem is that URLs don't like spaces. You can try it as:
"file://c:/program files/myExeDir/myProgram.exe+myParam" or
"file://c:/program files/myExeDir/myProgram.exe%20myParam"

Or you can instead use the Send Event script step with:
"c:/program files/myExeDir/myProgram.exe myParam" (including the quotes
this time)
 
Kees...
Posted: Wed Oct 14, 2009 11:03 am
Guest
On Tue, 13 Oct 2009 12:46:06 -0700, Howard Schlossberg
<howard at (no spam) nospam.fmprosolutions.com> wrote:


When I try script step 'Open Url' with %20 for spaces in the filename,
I always get file not found. I don't think that spaces are the
problem. The script without the parameter en without %20 does work
fine. The problem is that FM interprets the parameter as a part of the
filename

I've tried Send Event with 'specify file'
filewin:/C:/Program Files/exporteer adressen/verzendAdressen.exe
without params and it works.
But when I try filewin:/C:/Program Files/exporteer
adressen/verzendAdressen.exe myIni.ini I get:
The file verzendAdressen.exe myIni.ini could not be found. FM
interprets 'verzendadressen.exe myIni.ini' as one filename.

New ideas?

Greetings,
Kees




Quote:
Kees wrote:
In a script I start a exe with the script step:
URL open "file://c:/program files/myExeDir/myProgram.exe"
This works fine

The new version of myProgram wants a parameter. I'' ve tried:
"file://c:/program files/myExeDir/myProgram.exe myParam" or
"file://c:/program files/myExeDir/myProgram.exe" "myParam"
But both ways fail.

The problem is that URLs don't like spaces. You can try it as:
"file://c:/program files/myExeDir/myProgram.exe+myParam" or
"file://c:/program files/myExeDir/myProgram.exe%20myParam"

Or you can instead use the Send Event script step with:
"c:/program files/myExeDir/myProgram.exe myParam" (including the quotes
this time)
 
Kees...
Posted: Wed Oct 14, 2009 11:03 am
Guest
On Tue, 13 Oct 2009 18:56:34 +0200, "Ursus" <ursus.kirk at (no spam) ziggo.nl>
wrote:

Quote:
Parameters are often entered with a /
or go back to the previous version. If that worked, why change it?

I don't understand what you mean. If I put a / before the parameter it
still doesn't work.

The program that I want to start is used to export/convert the FM
database to a MySQL database. This program is used by 2 FM scripts in
2 FM databases (I wrote the external program). The parameter is used
to tell which ini file the external progam should use (the ini
stores corresponding MYSQL fieldnames and MYSQL field datatypes for
each FM field). Anyway this new version of the external program is
nescessary.


Greetings,
Kees
 
Ursus...
Posted: Wed Oct 14, 2009 9:45 pm
Guest
Kees,

Did I understand correctly you wrote the program you want to call?
If that is the case you could write two versions (or as much as you need)
each reading its own INI file then starting them with a calculated
commandline that starts the required version

if MyIni = a then
"file://c:/program files/myExeDir/myProgramA.exe"
else
"file://c:/program files/myExeDir/myProgramB.exe"
end if

Would that work?
--
Keep well / Hou je goed

Ursus
"Kees" <xxx at (no spam) yyy> schreef in bericht
news:q1tad55vie2bret7bp3msu7mrpdckl30ak at (no spam) 4ax.com...
Quote:
On Tue, 13 Oct 2009 18:56:34 +0200, "Ursus" <ursus.kirk at (no spam) ziggo.nl
wrote:

Parameters are often entered with a /
or go back to the previous version. If that worked, why change it?

I don't understand what you mean. If I put a / before the parameter it
still doesn't work.

The program that I want to start is used to export/convert the FM
database to a MySQL database. This program is used by 2 FM scripts in
2 FM databases (I wrote the external program). The parameter is used
to tell which ini file the external progam should use (the ini
stores corresponding MYSQL fieldnames and MYSQL field datatypes for
each FM field). Anyway this new version of the external program is
nescessary.


Greetings,
Kees

 
Howard Schlossberg...
Posted: Wed Oct 14, 2009 9:57 pm
Guest
Kees wrote:
Quote:
On Tue, 13 Oct 2009 12:46:06 -0700, Howard Schlossberg
howard at (no spam) nospam.fmprosolutions.com> wrote:

I've tried Send Event with 'specify file'
filewin:/C:/Program Files/exporteer adressen/verzendAdressen.exe
without params and it works.
But when I try filewin:/C:/Program Files/exporteer
adressen/verzendAdressen.exe myIni.ini I get:
The file verzendAdressen.exe myIni.ini could not be found. FM
interprets 'verzendadressen.exe myIni.ini' as one filename.


You need to have quotes around any portion of it that has spaces.
Otherwise, Windows' command line interpreter reads a space as the end of
the path.

For example, both of these work for me:

1) This one needs quotes around the program pathname because of the
spaces. But the 2nd and 3rd parameters do not require quotes because
there are no spaces within them:

"C:\Program Files\Real\RealPlayer\realplay.exe" /startpos:00:00:00.0
http://yp.shoutcast.com/sbin/tunein-station.pls?id=8291

2) This one requires quotes around each part of the request because
there are spaces in the program's filepath, as well as in the document's
filepath. Note this is different from my previous post where I had only
one set of quotes around the entire thing:

"C:\Program Files\UltraEdit\UEDIT32.exe" "C:\Documents and
Settings\Howard\My Documents\Conversion test.log"

Hope that helps...
 
Kees...
Posted: Wed Oct 14, 2009 11:08 pm
Guest
On Wed, 14 Oct 2009 10:57:37 -0700, Howard Schlossberg
<howard at (no spam) nospam.fmprosolutions.com> wrote:

.....
Quote:
You need to have quotes around any portion of it that has spaces.
Otherwise, Windows' command line interpreter reads a space as the end of
the path.

For example, both of these work for me:

1) This one needs quotes around the program pathname because of the
spaces. But the 2nd and 3rd parameters do not require quotes because
there are no spaces within them:

"C:\Program Files\Real\RealPlayer\realplay.exe" /startpos:00:00:00.0
http://yp.shoutcast.com/sbin/tunein-station.pls?id=8291


I've found the problem with script step 'send event'. After clicking
on specify, I did chose for 'file' while I should use text (strange
choice, I don't want to open text.... my English cause the problem
here). Setting the quotes was no problem and everythingnow works
fine. Thanks!

Greetings,
Kees
 
Kees...
Posted: Wed Oct 14, 2009 11:08 pm
Guest
On Wed, 14 Oct 2009 19:45:53 +0200, "Ursus" <ursus.kirk at (no spam) ziggo.nl>
wrote:

Quote:
Kees,

Did I understand correctly you wrote the program you want to call?
If that is the case you could write two versions (or as much as you need)
each reading its own INI file then starting them with a calculated
commandline that starts the required version

if MyIni = a then
"file://c:/program files/myExeDir/myProgramA.exe"
else
"file://c:/program files/myExeDir/myProgramB.exe"
end if

Would that work?

That would work, but it is a very ugly solution. Every time I have a
new version of the program I have to compile/build it twice.... etc..

I've found a solution (see other thread). Thanks for your
suggestions.

Greetings,
Kees
 
 
Page 1 of 1    
All times are GMT
The time now is Mon Dec 07, 2009 1:28 am