# Setting parameters via command line in Gatling in Windows

**URL:** <https://community.gatling.io/t/setting-parameters-via-command-line-in-gatling-in-windows/4470>\
**Category:** Gatling (Open-Source)\
**Created:** [August 28, 2018, 9:34am UTC](https://community.gatling.io/t/setting-parameters-via-command-line-in-gatling-in-windows/4470 "2018-08-28T09:34:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Devika\_Singhal](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@Devika\_Singhal](https://community.gatling.io/u/Devika_Singhal)\
**Post date:** [August 28, 2018, 9:34am UTC](https://community.gatling.io/t/setting-parameters-via-command-line-in-gatling-in-windows/4470/1 "2018-08-28T09:34:01Z")

</div>

Hi Team,

I am able to run a simulation from command line in Windows but when I am facing issues in passing users and ramp up time from command line.  
Please note, I have modified my script as per the below link.  
[https://gatling.io/docs/2.3/cookbook/passing\_parameters/](https://gatling.io/docs/2.3/cookbook/passing_parameters/)

Then, via command prompt I am unable to find a single command wherein I can set the JAVA\_OPTS variables and run a particular simulation. Request your help in this.  
After navigating to the bin folder, tried some of the below commands but nothing worked:  
a. **gatling.bat -s KnowNowHARNewObject JAVA\_OPT="-Dusers=2 -Dramp=20"**  
b. **set JAVA\_OPT="-Dusers=2 -Dramp=20" gatling.bat -s KnowNowHARNewObject**  
c. **set JAVA\_OPT="-Dusers=2 -Dramp=20" .\gatling.bat -s KnowNowHARNewObject**  
d. **set JAVA\_OPT="-Dusers=2 -Dramp=20" ./gatling.bat -s KnowNowHARNewObject**

Also, I tried in another option in 2 steps, but even this is not effective-  
**Step1:** Set the environment variables  
**set JAVA\_OPT="-Dusers=2 -Dramp=20"**

In order to check, ran the below command,  
**echo %JAVA\_OPT% and the output is :**  
**"-Dusers=2 -Dramp=20"**

**Step2: \*\bin\>**** gatling.bat -s KnowNowHARNewObject**  
**Expected Output:** As the JAVA\_OPTS variables are set to users=2 , hence the script should run with 2 users.  
**Actual Output:** Script runs with single user and results are generated.

**Request you to please help with the correct syntax for windows command line passing parameters at run-time.**

Regards,  
Devika

---

<div class="post-metadata">

**Author:** ![Matthew\_Presley](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Matthew\_Presley](https://community.gatling.io/u/Matthew_Presley)\
**Post date:** [September 19, 2018, 4:56pm UTC](https://community.gatling.io/t/setting-parameters-via-command-line-in-gatling-in-windows/4470/2 "2018-09-19T16:56:04Z")

</div>

I similarly passed variables but used

set JAVA\_OPTS= -Dusers=2 -Dramp=20

Not sure if it is as simple as omitting the quotation marks or not…

MP
