# Batch execution changes workspace path

**URL:** <https://forum.knime.com/t/batch-execution-changes-workspace-path/33479>\
**Category:** KNIME Analytics Platform\
**Tags:** batch\
**Created:** [June 4, 2021, 12:23pm UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479 "2021-06-04T12:23:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ema](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ema/32/368_2.png) [@Ema](https://forum.knime.com/u/Ema)\
**Post date:** [June 4, 2021, 12:23pm UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/1 "2021-06-04T12:23:44Z")

</div>

Hello,  
I’m trying to execute a workflow (WF\_test) in batch mode using this command in a .bat file:

C:\Program Files\KNIME\knime.exe" -nosplash -reset -application org.knime.product.KNIME\_BATCH\_APPLICATION -workflowDir=“C:\KNIME\_REPOSITORY\KnimeBatch\WF\_batch\WF\_test” -preferences=C:\KNIME\_REPOSITORY\preferences.epf -vmargs -Dlog4j.configuration=C:\KNIME\_REPOSITORY\log4j3.xml

Worflow is executed and log is produced, but i don’t understand why it changes the workspace’s path to “C:\Users\myname\knime-workspace”  
as showed in log:

 ![log_batch](https://forum-cdn.knime.com/uploads/default/original/3X/6/2/627422d75a0edfbf6b88ef751a64b09e911441bb.png)

(this folder doesn’t exists, so it creates this folder and put log there)

while my workspace is set to another directory: C:\KNIME\_REPOSITORY.  
I tried adding option -data= \<workspace\_path\> to the .bat, but it won’t change anything…

Could someone please help me to understand and fix that?  
Thank you  
(ps. Sorry, I’m not an expert)

Ema

---

<div class="post-metadata">

**Author:** ![Ema](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ema/32/368_2.png) [@Ema](https://forum.knime.com/u/Ema)\
**Post date:** [June 4, 2021, 12:50pm UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/2 "2021-06-04T12:50:28Z")

</div>

I think it’s also the reason why if I use relative paths for my tables (knime://…) in the workflow it fails execution: every path is substitute with the wrong path…

“C:\KNIME\_REPOSITORY” (right path) is replaced with “C:\Users\myname\knime-workspace”

---

<div class="post-metadata">

**Author:** ![Ema](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ema/32/368_2.png) [@Ema](https://forum.knime.com/u/Ema)\
**Post date:** [June 7, 2021, 6:22am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/3 "2021-06-07T06:22:25Z")

</div>

Seems that I’m not the only one who finds out this issue:

> [@Knime uses different workspace directory in batch mode](https://forum.knime.com/t/knime-uses-different-workspace-directory-in-batch-mode/27352):
>
> Hi there, I happen to recognize lately that, when Knime is run in batch mode, it operates in a different workspace. The log is attached to a report when executed in GUI mode but not when done in batch mode. #!/bin/bash cd /home/knime/Desktop/knime/ ./knime -consoleLog -nosplash -application org.knime.product.KNIME\_BATCH\_APPLICATION -reset -nosave --launcher.suppressErrors -workflowDir=/home/knime/Documents/knime-workspace/[WORKFLOW HERE] Default one used by Knime in batch mode: /home/knime/kn…

so, this problem is also on Linux.

---

<div class="post-metadata">

**Author:** ![marvin\_kickuth](https://forum-cdn.knime.com/user_avatar/forum.knime.com/marvin_kickuth/32/24811_2.png) [@marvin\_kickuth](https://forum.knime.com/u/marvin_kickuth)\
**Post date:** [June 7, 2021, 7:44am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/4 "2021-06-07T07:44:56Z")

</div>

Hi Ema,

That’s an interesting problem. Sadly I don’t know the answer, but I’m guessing the command line argument `-data=<workspace_path>` is being overwritten by another config file loaded.

Could you check the **knime.ini** file for a `-data` parameter? If its not in there, you could try the **`preferences.epf`** you are loading or changing the **`RECENT_WORKSPACES`** variable in `<knime-install-folder>\configuration\.settings\org.eclipse.ui.ide.prefs` (make sure to escape backslashes, colons, etc.). This last change will also affect KNIME when started normally.

Let me know, if any of these work for you 🙂

Kind regards  
Marvin

---

<div class="post-metadata">

**Author:** ![Ema](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ema/32/368_2.png) [@Ema](https://forum.knime.com/u/Ema)\
**Post date:** [June 7, 2021, 8:08am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/5 "2021-06-07T08:08:16Z")

</div>

Hi Marvin!

Thank you for your support, I tried the following:

(I changed the name of my workspace form KNIME\_REPOSITORY to KNIME\_WORKSPACE, same location, so it’s C:\KNIME\_WORKSPACE)

1. I added argument

-data \<workspace\_path\>

to the .ini file in the Knime’s installation directory, under the -vmargs, and re-execute the .bat but it won’t change

1. the preferences.epf file i use in the .bat  
has not a -data parameter, but i can see this lines:

/configuration/org.eclipse.ui.ide/MAX\_RECENT\_WORKSPACES=10  
/configuration/org.eclipse.ui.ide/RECENT\_WORKSPACES=C:\KNIME\_WORKSPACE  
/configuration/org.eclipse.ui.ide/RECENT\_WORKSPACES\_PROTOCOL=3  
/configuration/org.eclipse.ui.ide/SHOW\_RECENT\_WORKSPACES=false  
/configuration/org.eclipse.ui.ide/SHOW\_WORKSPACE\_SELECTION\_DIALOG=false

1. file org.eclipse.ui.ide.prefs in the installation direcotry has the following lines:

MAX\_RECENT\_WORKSPACES=10  
RECENT\_WORKSPACES=C:\KNIME\_WORKSPACE  
RECENT\_WORKSPACES\_PROTOCOL=3  
SHOW\_RECENT\_WORKSPACES=false  
SHOW\_WORKSPACE\_SELECTION\_DIALOG=false  
eclipse.preferences.version=1

seems that backslashes and columns are correctly excaped (it did automatically).

But it keep creating the folder C:\Users\myname\knime-workspace and using it as workspace…

thank you for any new suggestion

Ema

---

<div class="post-metadata">

**Author:** ![Ema](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ema/32/368_2.png) [@Ema](https://forum.knime.com/u/Ema)\
**Post date:** [June 7, 2021, 8:11am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/6 "2021-06-07T08:11:13Z")

</div>

ps. sorry that escapes are not showed here … but I promise they are in the original file

---

<div class="post-metadata">

**Author:** ![marvin\_kickuth](https://forum-cdn.knime.com/user_avatar/forum.knime.com/marvin_kickuth/32/24811_2.png) [@marvin\_kickuth](https://forum.knime.com/u/marvin_kickuth)\
**Post date:** [June 7, 2021, 8:40am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/7 "2021-06-07T08:40:46Z")

</div>

Thanks for testing all these settings. How peculiar.  
What happens when you start KNIME normally (with GUI)? Does that also use the wrong workspace location? If so, you can set it to C:\KNIME\_WORKSPACE via _File → Switch Workspace → Other…_

And just to be sure – your batch file does execute the correct knime.exe, right? Not some other installation elsewhere on your pc.

---

<div class="post-metadata">

**Author:** ![Ema](https://forum-cdn.knime.com/user_avatar/forum.knime.com/ema/32/368_2.png) [@Ema](https://forum.knime.com/u/Ema)\
**Post date:** [June 7, 2021, 8:46am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/8 "2021-06-07T08:46:43Z")

</div>

Hey Marvin,

workflow’s execution from GUI is correct, and when I start Knime normally it uses right workspace (i see also in the knime.workspace variable that path is correct, and relative paths for I/O files also work correctly), I have no other knime installations on my pc (this is the very first installation of Knime on a very new pc with wodows 10) 😪

---

<div class="post-metadata">

**Author:** ![marvin\_kickuth](https://forum-cdn.knime.com/user_avatar/forum.knime.com/marvin_kickuth/32/24811_2.png) [@marvin\_kickuth](https://forum.knime.com/u/marvin_kickuth)\
**Post date:** [June 7, 2021, 9:35am UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/9 "2021-06-07T09:35:56Z")

</div>

Hi Ema,

I’m afraid I’m out of ideas.  
Maybe its easiest to use the user folder… 😃

Kind regards  
Marvin

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [December 6, 2021, 9:36pm UTC](https://forum.knime.com/t/batch-execution-changes-workspace-path/33479/10 "2021-12-06T21:36:32Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
