Today build Jenkins continuous Integration environment, the compilation environment is. NET, there is no better code coverage test plug-in under. NET, so use open source Opencover, calculate code coverage, and then use Reportgenerator to export test reports in HMTL format. The batch script is used here, and here the problem arises.
After the script is written, it runs directly under the Windows system without any problems. But you have to put it in Jenkins as a compile-time execution, it will be an error, very strange. I also suspect that there is a problem with user rights. But it's still okay to run the script directly with a normal user. Google a bit in the afternoon. According to Http://stackoverflow.com/questions/10952280/ Execute-windows-batch-command-from-jenkins-fails-but-runs-fine-in-cmd-exe provided the way to try the OK.
The method is simple. is to sign in to Jenkins service.
Specific process:
Enter "Services.msc" in "Run" to open the service window and find "Jenkins".
Then right-click the property and select "This user" in the "login" navigation to any user who can run CMD.exe. Here I use the administrator user.
Jenkins failed to execute batch file