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

dir('c:\\') causes NullPointerException on Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.60.3
      Pipeline 2.5
      Pipeline: Basic Steps: 2.6

      Today I tried to change the current working directory using some absolute path name on on of my windows build agents. Unfortunately it reports a NullPointerException instead
      I tried both

      dir('c:\\')

      as well as

      dir('c:/')

      .

      I tried as well the following - which won't give me a NullPointerException but still won't work:

      dir('c:')
      dir('//?/c:/')
      dir('\\\\?\\c:\\')
      

      Hoever if I use

      dir('\\')

      it works just fine.
      Unfortunately until now I don't see a possibility to change to a different drive using that approach.
      E.g. Jenkins workspace is located on d: while I want to change to a directory located on c: drive.

            Unassigned Unassigned
            macdrega Joerg Schwaerzler
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: