How to run bat file in jenkins

前端 未结 3 1862
清酒与你
清酒与你 2021-01-02 09:04

My jenkins is installed in C:\\Program Files (x86)\\Jenkins

bat file is located in C:\\Users\\Admin\\workspace\\demoWork\\run.bat

W

3条回答
  •  轮回少年
    2021-01-02 09:18

    You have put very little detail into this so I'm going by pure guess..

    The Execute Windows batch command is to literally execute code, not execute a file.. to execute the file you could use this command :

    start cmd.exe /c C:\myprj\mybat.bat

    or you could take the contents of the .bat file and rewrite in in that command line..

    The way Jenkins works is it creates its own workspace for each job, essentially to sandbox the environment, its a testing framework so it should be used to stage changes to code, which will then be pushed to your live(working) environment. People use it to automate some tasks, but this isnt the primary use of Jenkins.. if the above doesn't help you let me know more details of the error and I can try help you with it.

提交回复
热议问题