jenkinsci / jenkinsci/durable-task-plugin

[JENKINS-52347] multi-line bat step isn't executed within a single console session

Open
#430 0 comments 0 reactions 0 assignees View on GitHub
component:durable-task-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
30
Forks
101
PR merge metrics
No merged PRs in 30d

Description

Executing a step similar to the following fails:




steps

{

  bat returnStatus: true, script: '''

  SET PATH = %PATH%;"C:ʅʅsomeʅʅpath"

  PATH'''

}




 

(I had to use special characters above because double back-slashes aren't displayed correctly by Jira.)

 

 The path is not being set:




[Pipeline] bat

[Jenkins Test-Pipeline] Running batch script

C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>SET PATH = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;"C:\some\path"

C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>PATH

PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps




 

---
Originally reported by settrend, imported from: multi-line bat step isn't executed within a single console session


  • assignee: kohsuke
  • status: Open
  • priority: Major
  • component(s): durable-task-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 2025-12-09

Raw content of original issue

Executing a step similar to the following fails:




steps
{
  bat returnStatus: true, script: '''
  SET PATH = %PATH%;"C:ʅʅsomeʅʅpath"
  PATH'''
}




 

(I had to use special characters above because double back-slashes aren't displayed correctly by Jira.)

 

 The path is not being set:




[Pipeline] bat
[Jenkins Test-Pipeline] Running batch script

C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>SET PATH = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;"C:\some\path"

C:\Program Files (x86)\Jenkins\workspace\Jenkins Test-Pipeline>PATH
PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Docker\Docker\Resources\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps




 

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.