1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Accessing variables set using SET /U or SET /S

Discussion in 'Support' started by cgunhouse, Oct 20, 2010.

  1. cgunhouse

    Joined:
    Dec 2, 2008
    Messages:
    209
    Likes Received:
    2
    How do you access variables set using SET /U or SET /S

    I want to pass PID information between different TCC session.

    For example:

    session one:

    SET /U S1PID=%_pid%

    session two:

    TASKEND /F %S1PID%

    Craig
     
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,520
    Likes Received:
    4
    cgunhouse wrote:

    | How do you access variables set using SET /U or SET /S
    |
    | I want to pass PID information between different TCC session.
    |
    | For example:
    |
    | session one:
    |
    | SET /U S1PID=%_pid%
    |
    | session two:
    |
    | TASKEND /F %S1PID%

    Combine the /E option with /U or /S to force the other sessions to see
    the variable. However, that still does not make them accessible to the
    parser, which you need to access the value. The method I found is to use
    @EXECSTR[set /u s1pid]
    which works correctly.
    Alternately, you can use Vince Fatica's plug-in 4UTILS.DLL, which has
    the command GSET to set the global variable, and the function @GV[] to
    retrieve its value.
    --
    HTH, Steve
     
  3. cgunhouse

    Joined:
    Dec 2, 2008
    Messages:
    209
    Likes Received:
    2
    Yes, that works for me, thanks!

    Craig
     
  4. vefatica

    Joined:
    May 20, 2008
    Messages:
    8,054
    Likes Received:
    30
    On Wed, 20 Oct 2010 13:46:06 -0400, Steve Fábián <> wrote:

    | Alternately, you can use Vince Fatica's plug-in 4UTILS.DLL, which has
    |the command GSET to set the global variable, and the function @GV[] to
    |retrieve its value.

    GSET and @GV use a proprietary registry key, HKCU\JPGlobal; that may be fine if
    sharing is the only objective.

    4UTILS also offers @GEV[name[,s|u|v|d]] to retrieve those set with SET s|u|v|d
    (or others in the registry's four environment keys).
     

Share This Page