Setting env variables


#1

Hey,

I’m trying to set some environment variables before I run Nuke, eg:

env.bat:
setx NUKE_PATH c:
uke
start “Nuke” “C:\Program Files\Nuke6.0v2\Nuke6.0.exe”

But, they only get set when I close Nukeand reopen it.

What’s the trick? I’ld like to keep it as bat script.

Cheers,

Nick d


#2

Why are you permasetting an environment variable every time you start Nuke and why aren’t you doing this through the environment variable settings dialog?


#3

Well, that’s the plan, this is just temp setup. Might fire up python a build something.


#4

setx permanently sets/changes an environment variable, but the variable is only available in future command windows. If you just want to set the environment variable temporarily while running nuke, you probably want to use set, but then you may have to add a /wait parameter to start so that the environment variable stays set until you exit nuke. I didn’t test this, but should be easy to check if it works.

env.bat:
set NUKE_PATH c:
uke
start /WAIT “Nuke” “C:\Program Files\Nuke6.0v2\Nuke6.0.exe”


#5

Or in you batch script:

NUKE_PATH=c:
uke
“C:\Program Files\Nuke6.0v2\Nuke6.0.exe”


#6

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.