Devenv.exe not not recognized as command through Jenkins

See the below error:

devenv …\code\framework\pc_sim\CCS_iso25119.vcxproj /Upgrade

‘devenv’ is not recognized as an internal or external command, operable program or batch file.

But same above cmd if I am running through windows command prompt its running successfully.
Is there any way to solve it?

Thanks in advance!

I am trying to use devenv.exe to upgrade VS project from Jenkins but it is giving license expired error.

But when I am using same command through windows command prompt, it is working fine.

Is there any way to solve it? Why is it showing license has expired in Jenkins?

Env used:
MS Visual Studio 2015 , running Devenv.exe through Jenkins

Thanks in advance!