Working with Named Connection Files when running Windows Task Scheduler as Local System Account

FME Form Support
FME Form Support
  • Updated

This article applies to Windows only

Considerations

The tasks created in Windows Task Scheduler is reported to run successfully, but the workspace log indicates that the translation has failed. There might be errors in the workspace log file similar to below:

WARN |Microsoft SQL Server Non-Spatial Reader: Failed to connect using Microsoft OLE DB Driver 19 for SQL Server. Provider error '(-2147217843) Invalid authorization specification'. Connection string 'Provider=MSOLEDBSQL19;DataTypeCompatibility=80;Data Source=;Initial Catalog=SQLServer<space>Connection;Use Encryption for Data=false;User ID=;Password=********'
ERROR |Failed to open reader
WARN |An error has occurred. Check the logfile above for details
INFORM|Translation FAILED with 1 error(s) and 3 warning(s) (0 feature(s) output)

Why This Happens

If Windows Task Scheduler is used to schedule and run workspaces under the local system account, FME Form is unable to find the correct path to the database or web connection storage. Any readers or transformers connecting to services using a database or web connection will fail.

How to Resolve It

FME needs to be told where the connection storage file is located and the value of other connection storage-related settings when running a workspace under the local system account via Windows Task Scheduler. This can be done using the fme executable with the APPLY_SETTINGS and SYSTEM options to specify where the named connection storage, shared key file is located. The SYSTEM option sets this information for the entire machine via the Windows Registry, allowing the local system user to access the information.

The steps below assume the connection files have already been shared or made public as outlined in Sharing Database and Web in FME Form.

Edit Batch File

Template batch files have been created and can be used to set the connection storage information for the machine after editing with the correct values for your environment. Follow the instructions from the appropriate section below based on the version of FME installed on your system. 

2024.0 and Newer

For FME 2024.0 and newer, download the setConnectionStorageSettings_2024.zip file from this article. Unzip and open the setConnectionStorageSettings_2024.bat file in a text editor.

Modify the variable value (the part after the equal sign) of any lines starting with set (lines 5-8) and replace the example value with the appropriate values for your environment. See table for an explanation of the variables and its value.

Line Variable Name
5 FME_HOME The folder of the FME install directory (eg. C:\Program Files\FME)
6 SHARED_DATABASE_FOLDER The folder containing the shared database fme_userconnection.data
7 SHARED_KEY_FOLDER The folder containing the shared encryption key fme_sharedKey.fmekey
8 SHARED_KEY_PASSWORD The password set on the shared encryption key. If a password has not been set on the encryption key, the variable value must be ""
Explanation of variable names and its intended value in  setConnectionStorageSettings_2024.bat

Variable values containing a space must be enclosed with double quotes. Variable values without spaces cannot be enclosed by double quotes. 

After changing the variable values to one appropriate for your system, save the .bat file and close the text editor.

2023.0 and Older

For FME 2023.0 and older, download the setConnectionStorageSettings_2023.zip file from this article. Unzip and open the setConnectionStorageSettings_2023.bat file in a text editor.

Modify the variable value (the part after the equal sign) after any lines starting with set (lines 5-10) and replace the example value with the appropriate values for your environment. See table for an explanation of the variables and its value.

Line Variable Name Variable Value
5 FME_HOME The folder of the FME install directory (eg. C:\Program Files\FME)
6 SHARED_DATABASE_FOLDER The folder containing the shared database fme_connections.data
7 PUBLIC_KEY_FILE The file path of the public encryption key. By default, the key name is fme_publicKey.fmeks. This value must be surrounded by double quotes
8 PUBLIC_KEY_FILE_PASSWORD The password set on the public encryption key. If a password has not been set on the encryption key, leave the value as empty
9 PRIVATE_KEY_FILE The file path of the private encryption key. By default, the key name is fme_privateKey.fmeks. This value must be surrounded by double quotes
10 PRIVATE_KEY_FILE_PASSWORD The password set on the private encryption key. If a password has not been set on the encryption key, leave the value as empty
Explanation of variable names and its intended value in  setConnectionStorageSettings_2023.bat

Variable values containing a space must be enclosed with double quotes and variable values without spaces cannot be enclosed by double quotes unless otherwise noted in the table above.

After changing the variable values to one appropriate for your system, save the .bat file and close the text editor.

Execute Batch File

Admin privileges are required for the following steps.

Locate the .bat file on your system. Right-click the file and choose 'Run as administrator'. A pop-up dialog may appear asking 'If you want to allow this app to make changes to your device?'. Select 'Yes'. A Command Prompt window will open and execute the commands in the file. 

FME should now be able to find the correct path to the named connection storage when a workspace is run through Windows Task Scheduler under the local system account.

Additional Notes

If you are still running into issues with database or web connections when running workspaces through Windows Task Scheduler under the local system account after modifying and running the .bat file, please check the following.

Variable Values with Spaces

Variable values containing spaces (eg. C:\Program Files\FME) must be enclosed by double quotes unless otherwise noted. This is because Windows Command Prompt will interpret any spaces as delimiters between arguments. When this occurs, the error often seen is Expected an even number of command line arguments.

Double Quotes and Variable Values without Spaces

Variable values without spaces cannot be enclosed by double quotes as Windows Command Prompt considers the double quotes as part of the variable’s value (e.g., "C:\ProgramFiles\FME"), leading to an incorrect value being set.

Spaces After Equal Sign

When assigning a value to a variable, no space is allowed between the variable name, the equal sign, and the value. Ensure none of the lines assigning a value to a variable have a space after the equal sign. For example:

set FME_HOME=C:\ProgramFiles\FME    & :: This is correct
set FME_HOME= C:\ProgramFiles\FME & :: This is incorrect

Version of FME Installed

Ensure you are using the correct .bat file for the FME version installed. Using the setConnectionStorageSettings_2024.bat for FME 2023 and older will not work and vice versa. FME searches for information relating to named connection storage in different locations for FME 2024 and newer compared to FME 2023 and older. The error may appear as Unable to decrypt data with specified encryption key if this is the case.

Encryption Key File Password

If the logfile shows OpenSSL decryption error: 'Unspecified internal error' or Encryption Error: AES Decrypt finalization failed, this usually indicates the encryption key file password provided is invalid for the key file. Check the password works within Workbench user interface and you can access the shared web or database connections with the same password.

Check Values Set in Windows Registry

Double-check the correct values have been set in Windows Registry. Open the Registry Editor by opening the Windows start menu and typing “Registry Editor”. This step require administrator privileges.

For 2024 and newer, go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Safe Software Inc.\Feature Manipulation Engine\Security and view the registry key values.Windows Registry Editor showing the registry keys at Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Safe Software Inc.\Feature Manipulation Engine\Security

For FME 2023 and older, go to Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Safe Software Inc.\Feature Manipulation Engine\Settings and view the registry key values. Any backslash (\) and space ( ) characters in the private and public encryption key file paths must be replaced with <backslash> and <space> respectively.

registryEditor_sharedConnections_2023.png

Was this article helpful?

We're sorry to hear that.

Please tell us why.

As of January 14th, 2026, comments on knowledge base articles have been closed. To make sure questions don’t get missed and to enable more community support, we’ve moved discussions to the FME Community. If you have a question or a comment about this article, please create a new post or create a support ticket.