Windows JNLP agent doesn't see PATH

7 views
Skip to first unread message

Vitaly Karasik

unread,
Jan 20, 2020, 7:55:40 AM1/20/20
to Jenkins Users
I see really weird behaviour on my Windows (Windows Server 2019) Jenkins agent (launched by JNLP).
Jenkins user has C:\Windows\system32 into its PATH (as well as other relevant paths).
But 

  bat '''
    any-command
  '''

fails with 

  'cmd' is not recognized as an internal or external command, 
  operable program or batch file.

unless I'm using PATH = "%Path%;C:\\WINDOWS\\SYSTEM32" into this step 'environment'.

So should I re-define the whole user's environment into my job or I'm missing something?

TIA,
Vitaly


Simon Richter

unread,
Jan 20, 2020, 9:22:57 AM1/20/20
to jenkins...@googlegroups.com
Hi,

On Mon, Jan 20, 2020 at 04:55:40AM -0800, Vitaly Karasik wrote:

> I see really weird behaviour on my Windows (Windows Server 2019) Jenkins
> agent (launched by JNLP).

I can't claim to have understood Windows agents' environment handling yet,
but it seems that the entire environment is frozen in the state the agent
had when it was first connected (i.e. saved then, and restored from the
master whenever the client reconnects).

Deleting and readding the agent seemed to help for me (use the same agent
name so it generates the same secret), this will refresh the environment
variables from the client.

Simon

Vitaly Karasik

unread,
Jan 20, 2020, 9:46:57 AM1/20/20
to Jenkins Users
Simon, thank you,
but as far as I see it's not the case - 'C:\Windows\system32' was part of the PATH from the start, I didn't add it.
Reply all
Reply to author
Forward
0 new messages