Using System to read mixed cased environment variables on Windows
- From: lamthierry@xxxxxxxxx (ThierryLam)
- Date: Fri, 27 Jun 2008 10:52:54 -0700 (PDT)
On Windows XP Pro 32 bit, if I want to output environment variables
PYTHON or ProgramFiles, I use the set command which output the
following:
C:\set PYTHON
PYTHON=C:\Python24\python.exe
C:\set ProgramFiles
ProgramFiles=C:\Program Files
If I used Perl 5.003_07 and use the system subroutine to show the
environment variables, I get the following. Perl script is:
system("set PYTHON");
system("set ProgramFiles");
Output is:
PYTHON=C:\Python24\python.exe
PROGRAMFILES=C:\Program Files
You'll notice that through system, the environment variable
ProgramFiles is all in upper case. Is there a way to preserve the
mixed case of the environment variable through system(...)?
.
- Follow-Ups:
- Prev by Date: Re: Check if directory is empty on Win32
- Next by Date: Pass a wild card argument in Win32
- Previous by thread: Check if directory is empty on Win32
- Next by thread: Re: Using System to read mixed cased environment variables on Windows
- Index(es):
Relevant Pages
|