# Setting a variable from a batch file

**URL:** https://www.finalbuilder.com/forums/t/setting-a-variable-from-a-batch-file/4912
**Category:** Discussion
**Created:** [February 6, 2013, 6:01am UTC](https://www.finalbuilder.com/forums/t/setting-a-variable-from-a-batch-file/4912 "2013-02-06T06:01:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![rob.langley](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/rob.langley/32/136_2.png) [@rob.langley](https://www.finalbuilder.com/forums/u/rob.langley)
#### Post date: [February 6, 2013, 6:01am UTC](https://www.finalbuilder.com/forums/t/setting-a-variable-from-a-batch-file/4912/1 "2013-02-06T06:01:39Z")

</div>

Hi

Is it&nbsp;possible&nbsp;to set a variable within a batch file which continua calls, and then for continua to pick it up and work with it?

I have tried

exit myvalue&nbsp;

within my batch file, but can't work out how to pick this up in continua.

Also tried to use SetX to write a system environment variable, but I would need to elevate permissions of the continua agent to use this as I get a error unable to write to registry

Just after the best way of achieving this

Thanks

Rob

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 7, 2013, 6:37am UTC](https://www.finalbuilder.com/forums/t/setting-a-variable-from-a-batch-file/4912/2 "2013-02-07T06:37:28Z")

</div>

Hi Rob   
  
 Yes, although it’s not documented yet :   
 [code] @echo offecho @@log{setvariable name=“myvariable” value=“hello world”}@echo on[/code]   
 Note in this case the @echo off is so that it doesn’t set the variable twice.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [February 7, 2013, 6:41am UTC](https://www.finalbuilder.com/forums/t/setting-a-variable-from-a-batch-file/4912/3 "2013-02-07T06:41:17Z")

</div>

Hi Rob   
  
 Forgot to mention that the variable must be defined on the configuration.

---

<div class="post-metadata">

### Author: ![rob.langley](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/rob.langley/32/136_2.png) [@rob.langley](https://www.finalbuilder.com/forums/u/rob.langley)
#### Post date: [February 7, 2013, 11:09am UTC](https://www.finalbuilder.com/forums/t/setting-a-variable-from-a-batch-file/4912/4 "2013-02-07T11:09:15Z")

</div>

Thanks, this did the job :-)

Rob
