Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52347

multi-line bat step isn't executed within a single console session

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major Major
    • durable-task-plugin
    • None

      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


       

            kohsuke Kohsuke Kawaguchi
            settrend A. D.
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: