Re: Environment variables in batch files?
- From: "David H. Lipman" <DLipman~nospam~@Verizon.Net>
- Date: Mon, 29 Aug 2005 12:32:49 -0400
From: "Linn Kubler" <lkubler@xxxxxxxxxxxxxxxxxx>
| Hi,
|
| Why is it that I can set an environment variable in a logon batch file but
| when I type 'Set' in a command window I don't see my environment variable in
| the list?
|
| Thanks in advance,
| Linn
|
Because the variable is created and used in a daughter process and is not passed up to the
parent process. Once the batch file ends (or the Command Prompt closes) the daughter
process ends and the variable no longer exists.
In Win9x/ME Environmental Variables are added to the AUTOEXEC.BAT file and the system will
then need to be rebooted. Then the variables will be available (WinME actually will parse
the AUTOEXEC.BAT file and update the Registry) On NT based OS's you have to; Right click on
"My Computer", choose "Advanced", then "Environmental Variables" and add a "user" or
"global" (system) variable.. Then the variable will be available in all daughter processes.
--
Dave
http://www.claymania.com/removal-trojan-adware.html
http://www.ik-cs.com/got-a-virus.htm
.
- Follow-Ups:
- Re: Environment variables in batch files?
- From: Linn Kubler
- Re: Environment variables in batch files?
- References:
- Environment variables in batch files?
- From: Linn Kubler
- Environment variables in batch files?
- Prev by Date: Environment variables in batch files?
- Next by Date: VB Script - Need Help CIM_DataFile, Win32_Share
- Previous by thread: Environment variables in batch files?
- Next by thread: Re: Environment variables in batch files?
- Index(es):
Relevant Pages
|
Loading