πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #206

Re: retrieving standard program path from Windows

#206
From: Lori M Olson [TeamB]
Date: Thu, 09 Jun 2005 02:07
38 lines
2128 bytes
Shankar Unni wrote:
> Oliver wrote:
> 
>> at the moment im trying to retrieve the standard program path 
>> ("C:\Programme"
> 
>  > or "C:\Program Files" or ... itοΏ½s language dependent) from Windows 2000
>  > with my Java program (JDK 1.5).
> 
> Have you tried looking for an environment variable (or property) called 
> "ProgramFiles" or "PROGRAMFILES" (depending on which sort of shell you 
> start your program from)?

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getenv(java.lang.String)

On my Windows 2003 Server, the environment variable is "ProgramFiles"

Note that System.getenv() was deprecated from JDK 1.1 to JDK 1.4, 
resurfacing in JDK 1.5.

-- 

Regards,

Lori Olson [TeamB]

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

Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.

Google Advanced Newsgroup Search
     http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
     http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
     http://www.visi.com/~gyles19/fom-serve/cache/1.html
Technical Details
Message-ID: <42a7a445$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <42a6f2ac$1@newsgroups.borland.com> <42a794b6$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 1089d0,b523e2611fbd7782
X-Google-Attributes: gid1089d0,public
X-Google-Language: ENGLISH,ASCII
Date: Wed, 08 Jun 2005 20:07:02 -0600
From: "Lori M Olson [TeamB]" <javadragon@techie.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: retrieving standard program path from Windows
References: <42a6f2ac$1@newsgroups.borland.com> <42a794b6$1@newsgroups.borland.com>
In-Reply-To: <42a794b6$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 142.179.181.200
Message-ID: <42a7a445$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1118282821 142.179.181.200 (8 Jun 2005 19:07:01 -0700)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail