Skip to main content
Solved

Run workbench from command line


miquelrs
Contributor
Forum|alt.badge.img+7

I am trying to run a workbench from a batch file. The workbench is found in a shared drive (with access permissions), while FME is installed in the C: drive. According to what I've seen in the forums it is a simple command line. However, when running from a batch file, the following error arises: "The specified path is invalid".

The batch file is stored in the same shared drive. I have tried the following options, using two path formats "\\\\shareddrive\\maps\\" and "Y:\\":

Option one:

"C:\\Program Files\\FME\\fme.exe" "\\\\shareddrive\\maps\\FME\\AddressGaz.fmw"

Option two:

"C:\\Program Files\\FME\\fme.exe" "Y:\\FME\\AddressGaz.fmw"

 

In theory "\\\\shareddrive\\maps\\" and "Y:\\" are equivalent.

 

I don't know what I am doing wrong. Does anybody have a clue?

Thanks

Best answer by jdh

Does "C:\Program Files\FME\fme.exe" "\\shareddrive\maps\FME\AddressGaz.fmw"   work from the command line  (not in a batch file)?

 

 

If so, you may have luck with 
net use {driveletter}: \\{servername}\{sharename} /persistant:yes

in the batch file prior to the FME call

View original
Did this help you find an answer to your question?

7 replies

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 29, 2019

If the batch fie is in the same folder, you do not need to repeat the path:

"C:\\Program Files\\FME\\fme.exe" "AddressGaz.fmw"

This should work too.


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • March 29, 2019
erik_jan wrote:

If the batch fie is in the same folder, you do not need to repeat the path:

"C:\\Program Files\\FME\\fme.exe" "AddressGaz.fmw"

This should work too.

My guess is you are using the batch file in a Windows Scheduler.

The scheduler is run as a different user, not having the same privileges as you have.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • March 29, 2019

Does "C:\Program Files\FME\fme.exe" "\\shareddrive\maps\FME\AddressGaz.fmw"   work from the command line  (not in a batch file)?

 

 

If so, you may have luck with 
net use {driveletter}: \\{servername}\{sharename} /persistant:yes

in the batch file prior to the FME call


miquelrs
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • March 29, 2019
erik_jan wrote:

If the batch fie is in the same folder, you do not need to repeat the path:

"C:\\Program Files\\FME\\fme.exe" "AddressGaz.fmw"

This should work too.

You guessed right, as I was using another user from the scheduler one. However, I have switched now to the scheduler user but the error is still there. Don't know why but the answer provided by @jdh worked.


miquelrs
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • March 29, 2019
jdh wrote:

Does "C:\Program Files\FME\fme.exe" "\\shareddrive\maps\FME\AddressGaz.fmw"   work from the command line  (not in a batch file)?

 

 

If so, you may have luck with 
net use {driveletter}: \\{servername}\{sharename} /persistant:yes

in the batch file prior to the FME call

The command actually works from the command line, but it doesn't from the batch file. Thanks, your solution worked perfectly. Any clue of why my solution didn't work?


miquelrs
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • March 29, 2019
erik_jan wrote:

If the batch fie is in the same folder, you do not need to repeat the path:

"C:\\Program Files\\FME\\fme.exe" "AddressGaz.fmw"

This should work too.

Thanks for your help by the way, as you said, I should have been using the scheduler user in the first place.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 29, 2019
miquelrs wrote:

The command actually works from the command line, but it doesn't from the batch file. Thanks, your solution worked perfectly. Any clue of why my solution didn't work?

UNC paths are persnickety?

 

 

I actually don't know why, but sometimes we have issue reading a file on an UNC path, until we access the root share path directly.

 

 

ie \\\\server\\share\\file won't open, unless we access \\\\server\\share in the session first.

 

 

By explicitly mapping the sharename to a drive letter, and persisting it, we are forcing access to the share.

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings