# Jenkins Text Parameters Not Being Escaped

**URL:** <https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316>\
**Category:** Ask a question\
**Created:** [August 31, 2023, 8:54am UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316 "2023-08-31T08:54:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudiminty](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/rudiminty/32/5344_2.png) [@rudiminty](https://community.jenkins.io/u/rudiminty)\
**Post date:** [August 31, 2023, 8:54am UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316/1 "2023-08-31T08:54:15Z")

</div>

Jenkins setup: Jenkins installed on Windows Server, running ANT build file.

When setting up a text paramer on my build, it seems that values that end with the = character, are not escaped correctly.

For example, a text paramater value being supplied of “ABC” results in the following console line:  
[Jenkins] $ cmd.exe /C "ant.bat -file manage-instances.xml -DciimsProKey=ABC

However, if the text paramater value being supplied contains special characters like “ABC==” then the results in the console line look as follows:  
[Jenkins] $ cmd.exe /C “ant.bat -file manage-instances.xml -DciimsProKey=ABC==”"  
When this happens, the property echo’ed in ant displays as “ABC” without teh special chacters.

What I need is for the console line to be something like this:  
[Jenkins] $ cmd.exe /C "ant.bat -file manage-instances.xml -DciimsProKey=“ABC==”  
When this happens, I woud lthe expect the property being echo’ed in ant to display as “ABC==”

When I manually start and end the text paramater value with the double quotes, it does escape teh quotes.

Any advise on how to get jenkins to inclde teh double-quotes for these text paramters?

---

<div class="post-metadata">

**Author:** ![slide\_o\_mix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/32/20977_2.png) [@slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix)\
**Post date:** [August 31, 2023, 3:12pm UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316/2 "2023-08-31T15:12:49Z")

</div>

Have you tried setting the value as an environment variable and then using that environment variable in the command? Cmd.exe has some really crappy escaping rules.

---

<div class="post-metadata">

**Author:** ![rudiminty](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/rudiminty/32/5344_2.png) [@rudiminty](https://community.jenkins.io/u/rudiminty)\
**Post date:** [August 31, 2023, 3:42pm UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316/3 "2023-08-31T15:42:43Z")

</div>

Thanks Alex, but I need the user to enter these unique parameter values (paramatarized build) manually when starting the build, so env vars are not really an option.

Kind regards

Rudi Minty  
072 191 4654

EXTERNAL SENDER - CAUTION: This email originated from outside of the organisation. Do not click on links, or open attachments unless you recognise the sender and know the content is safe.

> ![](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/45/19_2.png "slide\_o\_mix") | [slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix) Alex Earl  
> August 31 |
> 
> - | - |

Have you tried setting the value as an environment variable and then using that environment variable in the command? Cmd.exe has some really crappy escaping rules.

---

<div class="post-metadata">

**Author:** ![slide\_o\_mix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/32/20977_2.png) [@slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix)\
**Post date:** [August 31, 2023, 4:38pm UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316/4 "2023-08-31T16:38:51Z")

</div>

How are you invoking ant? Are you using the ant plugin or are you creating the command line yourself?

---

<div class="post-metadata">

**Author:** ![rudiminty](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/rudiminty/32/5344_2.png) [@rudiminty](https://community.jenkins.io/u/rudiminty)\
**Post date:** [August 31, 2023, 4:54pm UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316/5 "2023-08-31T16:54:22Z")

</div>

Yes, using Ant plugin.

Kind regards

Rudi Minty

EXTERNAL SENDER - CAUTION: This email originated from outside of the organisation. Do not click on links, or open attachments unless you recognise the sender and know the content is safe.

> ![](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/45/19_2.png "slide\_o\_mix") | [slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix) Alex Earl  
> August 31 |
> 
> - | - |

How are you invoking ant? Are you using the ant plugin or are you creating the command line yourself?

---

<div class="post-metadata">

**Author:** ![slide\_o\_mix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/32/20977_2.png) [@slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix)\
**Post date:** [August 31, 2023, 5:08pm UTC](https://community.jenkins.io/t/jenkins-text-parameters-not-being-escaped/9316/6 "2023-08-31T17:08:52Z")

</div>

Are you specifying the parameter value in the properties section (or are you using pipeline)? Can you share your setup and invocation of the ant plugin?
