Question

Set working directory in SystemCaller...

  • 27 February 2019
  • 7 replies
  • 15 views

Badge +2

Hi all,

With the SystemCaller I am kicking off an executable

That executable is looking for a file with parameters in the working directory

 

So if I use the Command Line in Windows, I go to D:\\TEMP

That then is my working directory and it has the parameter file : parameter.ini

When I start the executable it uses this ini file

 

But when I use SystemCaller and I set the working directory, the executable seems not to find the .ini file somehow

 

Anyone an idea?

 

I now use the PUSD command to set the working directory

 

Then starting the executable

 

Then close the command string with POPD

7 replies

Userlevel 2
Badge +16

Have you tried:

CD D:\\TEMP

D:

That would change the directory followed by changing the device drive to D.

That is the way it is done in the CMD window and the SystemCaller should work the same way.

Badge +2

Have you tried:

CD D:\\TEMP

D:

That would change the directory followed by changing the device drive to D.

That is the way it is done in the CMD window and the SystemCaller should work the same way.

Unfortunately that doesn't work @erik_jan

But thanks for your reaction!

Userlevel 4

You could always try to use a batch file in the SystemCaller.

Otherwise you should consider contacting the developers of the executable, to better understand how it looks for the .ini file.

Userlevel 4
Badge +26

heya @HarmenKampinga,

 

 

To make sure that the SystemCaller is correctly changing the path you can use the following system call after the creator:

 

 

cd C:\\ && DIR && cd D:\\ && D: && DIR

 

 

In the FME log window you should should see the first the directory list of the C drive, followed by the Directory list of the D drive.

 

 

I would also echo David's comment here on how it looks for the parameter file if you're not having luck
Badge +2

You could always try to use a batch file in the SystemCaller.

Otherwise you should consider contacting the developers of the executable, to better understand how it looks for the .ini file.

Yeah, that's also the direction my developer is pointing at

He also changed the executable, so I have now parameters to work with

Let's see what happens then

Badge +2

heya @HarmenKampinga,

 

 

To make sure that the SystemCaller is correctly changing the path you can use the following system call after the creator:

 

 

cd C:\\ && DIR && cd D:\\ && D: && DIR

 

 

In the FME log window you should should see the first the directory list of the C drive, followed by the Directory list of the D drive.

 

 

I would also echo David's comment here on how it looks for the parameter file if you're not having luck

Hi @virtualcitymatt ! Thanks for your suggestion

Now our developer has changed something in the executable, I'll have a try with that first

Keep you all posted!

Badge +2

You could always try to use a batch file in the SystemCaller.

Otherwise you should consider contacting the developers of the executable, to better understand how it looks for the .ini file.

the executable was changed so a parameter can be added that point to the ini file

that parameter I am using now in the SystemCaller

Our developer also suggested at first the batch file, but adding the option is a better solution.

Your answer is the closest to the solution.

 

Thank you, @david_r, and also @virtualcitymatt @erik_jan again! Have a nice weekend!

 

Reply