Just guessing, but is your Jenkins on Windows configured to run as a service? If so, then there may be portions of your build which assume that a desktop is available, or that the process is running in a desktop context.
I spent a little time wrestling with trying to perform builds as a service. Eventually I stopped, frustrated because I had some tests which I knew would need to run as a desktop and there was not enough benefit to the organization by me spending time investigating how to
run a build as a service when no one cares if the build runs as a service.
I now configure any Windows Jenkins server to always from a logged in desktop session rather than as a service. Your mileage may vary...
Mark Waite