# Updating environment variables from a task

**URL:** https://www.finalbuilder.com/forums/t/updating-environment-variables-from-a-task/226
**Category:** Discussion
**Created:** [October 16, 2006, 8:32am UTC](https://www.finalbuilder.com/forums/t/updating-environment-variables-from-a-task/226 "2006-10-16T08:32:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![andreas.axelsson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andreas.axelsson](https://www.finalbuilder.com/forums/u/andreas.axelsson)
#### Post date: [October 16, 2006, 8:32am UTC](https://www.finalbuilder.com/forums/t/updating-environment-variables-from-a-task/226/1 "2006-10-16T08:32:23Z")

</div>

How can I execute a task, say a batch script, which modifies the environment variables, and have FB pick up the changes? I have a setup script for our project, which everyone uses to configure the local environment for a given branch of a project. I’d need to run that as one of the initial tasks, but I don’t know how I can make it grab any changes to the environment and apply them to future tasks. I could run it before starting FB of course, but then I can’t use the FB CCNet task on the build server.  
  
/axl

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [October 16, 2006, 9:15am UTC](https://www.finalbuilder.com/forums/t/updating-environment-variables-from-a-task/226/2 "2006-10-16T09:15:01Z")

</div>

Hi Andreas,  
  
Maybe your batch script could write the environment variables to an INI file which you can then read in with the Read INI File action in FinalBuilder?  
  
.t8

---

<div class="post-metadata">

### Author: ![andreas.axelsson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andreas.axelsson](https://www.finalbuilder.com/forums/u/andreas.axelsson)
#### Post date: [October 16, 2006, 9:21am UTC](https://www.finalbuilder.com/forums/t/updating-environment-variables-from-a-task/226/3 "2006-10-16T09:21:44Z")

</div>

Thanks, I’ll try that.

---

<div class="post-metadata">

### Author: ![andreas.axelsson](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@andreas.axelsson](https://www.finalbuilder.com/forums/u/andreas.axelsson)
#### Post date: [October 17, 2006, 3:17am UTC](https://www.finalbuilder.com/forums/t/updating-environment-variables-from-a-task/226/4 "2006-10-17T03:17:15Z")

</div>

I ended up writing a batch file which first sets up the environment and then calls the fbcmd.exe with the passed arguments. My environment changes include path order, and all sorts of settings that would be a lot of work to import into every fb script.  
  
Cheers,  
/axl
