Went through a very irritating "feature" of Jenkins in Windows, the fact that it runs as the default system user.
From there you have to options:
- Change the system user to have the dependencies you need, or
- Use a regular account
I went with the later.
The symptom is that commands executed in the Build - Execute Windows batch command step will not be able to find executables, despite the fact that they are defined in %PATH%.
A good way to diagnose is to check that you really have the %PATH% properly set and identify who's running the command. Use these two lines:
To solve set the properties in the Jenkins service to use the user you wan and that should marry things just nicely. There are drawbacks in using user accounts like that but it's much easier and have the expected behaviour.