Re: Persisting env vars in cmd windows
- From: "Richard" <RichardDummyMailbox58407@xxxxxxxxxxxxxxxxxxx>
- Date: 5 Nov 2006 21:14:30 -0800
Hi GO,
I think you're right. I just realized that as I was documenting a
detailed response to Pegasus. It's midnight, my time, right now, so
I'll try that out tomorrow.
Regards,
Richard
GO wrote:
Hi Richard,
Are these variables you are setting static or dynamic? That is are the
values changing through out the batch file and do those new values need be
be available to the other batch files? If the values are static, which is
what it sounds like, then you simply need to "call" the batch file containg
your "symbol-setter". So at the beginning of your utility batch file you
would have a line:
call <symbol-setter>.bat
where <symbol-setter> is the name of your batch file. If said batch file is
not located in your search path then you will have to specify the full path
to it's location (eg: C:\batchfiles\symbol-setter.bat).
If your variables are dynamic then you will most likely have to create a
temporary batch file that echos the variables and values and call that as
needed. There may be a more elegant way to do that but I'm not sure.
HTH,
Greg
Richard wrote:
I've got a .bat file that sets a number of symbols (environment vars)
that are useful in a number of other command windows associated with
one of several projects. Right now, I operate by
1 opening a command window
2 draging the name of the symbol-setting bat file into the new cmd
window and pressing Enter
3 draging the name of one of my utility bat files in the cmd window
and pressing Enter
4 proceeding manually entering other commands as needed.
I'd like to eliminate step 2 by invoking the symbol-setter at the
beginning of every other utility file. I tried this by using "cmd /c
symbol-setter.bat" to no avail. I believe that fails because the "cmd
/c" command starts a new session in which to set local env. vars and
then ends, never communicating with the invoking session.
The best solution I can conceive of is to manually write a .reg file
appropriate to each project in which I want persistant env. vars, thus
only needing to invoke that once at the inception of a project, maybe
with another one to delete all such entries should the project
ultimately be destroyed.
Any comments?
Regards,
Richard
.
- References:
- Persisting env vars in cmd windows
- From: Richard
- Re: Persisting env vars in cmd windows
- From: GO
- Persisting env vars in cmd windows
- Prev by Date: Re: Persisting env vars in cmd windows
- Next by Date: Re: Recent purchase of Win 2000 from Ebay
- Previous by thread: Re: Persisting env vars in cmd windows
- Next by thread: Re: VBScript
- Index(es):
Relevant Pages
|