How to read environment variable from a node via jenkins windows batch command

13 views
Skip to first unread message

gurudatt SA

unread,
Oct 6, 2017, 12:38:12 PM10/6/17
to Jenkins Users
Hi All,

The code which is executing in the workstation is setting an System variable. And i want to read the system variable from jenkins job - Windows batch command during execution.

Is there a way to do this ?

I have tried the classic way to read the system variable from command line - Echo %MyVariable%, but its not returning anything.

Thanks in advance.

Victor Martinez

unread,
Oct 6, 2017, 1:19:58 PM10/6/17
to Jenkins Users
How the agent is connected to the master?

Robert Hales

unread,
Oct 6, 2017, 3:39:49 PM10/6/17
to Jenkins Users
It is hard to answer this without more detail on your jobs. i.e. Is this a freestyle job? How and where is the environment variable set?  Sounds to me like a scope issue. For example, if you are setting the variable in one shell script, then trying to get to it in another, it isn't going to work. 
Reply all
Reply to author
Forward
0 new messages