When STAFProc is started, it runs with the environment variables that were 
set at that time.  You can't change the environment variables for STAFProc 
(or really for any application) after it has started.  STAF/Env/xxx 
variables like STAF/Env/Path are basically "read-only" variables that show 
you the environment variables settings for STAFProc.  You should not be 
changing the values of STAF/Env/xxx variables.

When you use the STAF PROCESS service to run a command, it runs in the 
same environment as STAFProc.  To change or set a new environment variable 
when running a command via a PROCESS START request, you can use the ENV 
option(s) to set  environment variables.  For example:

C:\>STAF local PROCESS START SHELL COMMAND "set" ENV 
PATH=C:\value;{STAF/Env/Path} RETURNSTDOUT STDERRTOSTDOUT WAIT
Response
--------
{
  Return Code: 0
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       : <Removed environment variables prior to PATH>
Path=C:\value;
C:\jdk1.5.0_07\bin;C:\STAF\bin;C:\WINNT\system32;C:\WINNT;<Removed rest of 
PATH output>
<Removed environment variables after PATH>

    }
  ]
}

See the STAF User's Guide for more information on the ENV option at 
http://staf.sourceforge.net/current/STAFUG.htm#HDRPROCSRV.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




Siu Tam/Westford/i...@lotus 
06/01/2010 08:34 AM

To
staf-users@lists.sourceforge.net
cc

Subject
[staf-users] Question on Setting values to an Environmental Variable






I am trying to set a value to an environment variable so that the 
processes
proceeding directly after will be able to use the values. 

I am using the VAR service command staf <IP Address> var set var 
STAF/Env/Path="c:\value".

The variable appears to be set properly since when the command staf <IP 
Address> var list is used the newly set values do show up. 
However, a command that is passed in directly after does not recognize the 
new path variable.

Is this the proper command to use, or is there another way to do this?

Thanks
-Larry
------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

------------------------------------------------------------------------------

_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to