The system cannot find the specified drive in Jenkins

后端 未结 9 2404
半阙折子戏
半阙折子戏 2021-02-15 15:17

I want to copy some files from a network shared drive (mounted at my local machine as drive Z). I have written a Batch file to copy the contents of Z drive into my local drive.

9条回答
  •  误落风尘
    2021-02-15 15:57

    Had this issue where my jenkins job was unable to read files present on the network drive. I resolved it by adding "net use" command in your pre-build step. i.e.

    Open your job. Go to Pre Steps From the drop down, select Execute Windows Batch Command Enter the following command: net use E: \[server name][Folder name] "[password]" /user:"[userid]" Click Save Execute the job

    I was able to read files from my network drive by following the steps mentioned above.

    It seemed to be a one time activity as after the initial run, I had removed the batch command from my job and it seemed to remember the mapped drive command.

提交回复
热议问题