Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


MattL
  •  MattL
  • No customer Topic Starter
2009-04-29T23:18:10Z
Is there a way to set the value of an environment variable for all the tasks in a job? Ideally the list of tasks would look something like this:

1 - Setup Environment Variables
2 - Download some files
3 - Do some work
4 - Email results

I know I can do it with a batch file or by setting up a user with the correct environment and running the tasks as that user, but neither of those solutions are ideal. Do I have any other options?
Sponsor
Forum information
Support
2009-04-30T09:11:59Z
Maybe we can add something globally. So you can set env variables for the current user. Or do you only want it for the current Job?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattL
  •  MattL
  • No customer Topic Starter
2009-04-30T16:36:02Z
Ideally it would change the environment for all the tasks in the current job and leave the system/user environment alone.
Support
2009-04-30T16:51:52Z
You could use the normal User Variables in the Variables section.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattL
  •  MattL
  • No customer Topic Starter
2009-04-30T17:09:14Z
Thank you for the quick response...I see how to read the environment variables, but not how to set them so a subsequent execute task will run with the modified environment. For example, I want to adjust the OracleRootDir and TNS_ADMIN environment variables to use a specific Oracle configuration. Then execute an application with the modified oracle environment.
Support
2009-04-30T19:39:38Z
I don't know how you use the Oracle connection. But if it is a VisualCron connection you could use the Variable in the connection string.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattL
  •  MattL
  • No customer Topic Starter
2009-04-30T19:51:11Z
I picked the Oracle environment variables as an example. It could have just as easily been any other environment variable such as the current PATH string.

Just to be sure we are talking about the same set of environment variables...open a command prompt and type env. Those are the environment variables I want to modify. For example, how could I configure a task to append another directory to the PATH string before launching an application.

Thanks again for your help.
Support
2009-04-30T20:44:48Z
OK, I got confused because you said you wanted a Variable for a single Job only. Windows Variables are global. We have no SET ENV Task so you have to do this in a .bat file right now.

I guess an Set env Task would be handy to have in this case.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattL
  •  MattL
  • No customer Topic Starter
2009-04-30T21:06:34Z
Yes, it would be very handy. We have about 100 jobs that execute, adding a Set Env Task to each job is fine because I can clone them so easily. Instead of a new type of task, another potential option would be to merge environment variables into the execute task's process before executing the command.

So here is a follow-up question related to the same topic. If I have two sequential execute tasks in a job, do they get launched in the same environment or does each execute task get a new environment?

What I am wondering is this...if I execute a .bat file to change the environment as the first task in a job, will subsequent tasks see the modified environment variables or will subsequent execute tasks run with the default environment variables?
Support
2009-05-02T12:11:42Z
A .bat file always change the global enviroment (Windows) which VisualCron exists in. It is not possible to set a Windows environment Variable for a specific Job.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattL
  •  MattL
  • No customer Topic Starter
2009-05-04T16:53:33Z
Could I make a formal request to add the option to set specific environment variables on an single Execute task?
Support
2009-05-04T17:07:56Z
Yes, we can check this as well.

MattL wrote:

Could I make a formal request to add the option to set specific environment variables on an single Execute task?



Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
MattL
  •  MattL
  • No customer Topic Starter
2009-05-04T17:17:50Z
Thank you. Please keep me posted on any progress.
Scroll to Top