Skip to main content

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

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.


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.


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


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.


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?


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.


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