setx is not the counterpart of Linux export in Windows. export just makes the variable available temporarily to the current shell and its children processes whereas setx stores the variable permanently to every user or system process in the future.
You didn't show all the real commands you used so based on the comments I guess you ran these
setx OPENAI_LOG_FORMAT 'stdout,log,csv,tensorboard'
setx OPENAI_LOGDIR path/to/tensorboard/data
tensorboard --logdir=$OPENAI_LOGDIR
which is absolutely wrong!!!
First setx is supposed to be run only once, thus if you want to set the environment for the current session then you must use set instead of setx. If you do want to set the variable permanently then you'll still need to restart the shell so the changes apply, and never run the command again
Besides single quote isn't a quoting character in cmd so you'll need to remove '' and use stdout,log,csv,tensorboard, or use double quotes "stdout,log,csv,tensorboard" if your program does quote removal by itself
And lastly, variables in cmd are accessed with %% instead of $ like bash, hence you must change the last line to tensorboard --logdir=%OPENAI_LOGDIR%. The final result is like this
set "OPENAI_LOG_FORMAT=stdout,log,csv,tensorboard"
set "OPENAI_LOGDIR=path/to/tensorboard/data"
tensorboard --logdir=%OPENAI_LOGDIR%
This is still a guess until you provide enough information in the question
setx /mwill be available in the next cmd window you open but will not be available in the current window. Usesetxif you want the variable to be available in the current window. – somebadhat Nov 08 '19 at 14:07$OPENAI_LOGDIRis not fetching the variable value – singh adi Nov 09 '19 at 05:20cmd, the syntax is%VariableName%. So,%OPENAI_LOGDIR%. Also, you might want to considersetinstead ofsetx, depending on your use case. – Daniel B Nov 14 '19 at 20:01