Solved

Run workbench from command line

  • 29 March 2019
  • 7 replies
  • 119 views

Badge +1

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

icon

Best answer by jdh 29 March 2019, 15:53

View original

7 replies

Userlevel 2
Badge +16

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.

Userlevel 2
Badge +16

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.

Badge +22

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

Badge +1

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.

Badge +1

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?

Badge +1

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.

Badge +22

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