Periods in Path

V

VManes

While working on some code to programatically add a directory to a user's
path, I noticed that some of the directory entries installed by MS apps end
with a period, such as :
<<snip>>C:\Program Files\Microsoft SDK\Bin\.;C:\Program Files\Microsoft
SDK\Bin\WinNT\.

Anyone know what the effect of this is, or the effect of deleting the
periods? Most other entries in the path do not end in '\' or '\.'

For that matter, short of using a full blown installer (InstallShield or
similar), is there an easier way to modify the path and set other
environment variables rather than the C program I've got. This will be used
for many users, so manually modifying setting them is not a good option.
tia,
Val
--
Bringing you BeadWizard Design Software
www.beadwizard.com
***************************
Practice safe eating -- always use condiments.
***************************
 
T

Torgeir Bakken (MVP)

VManes said:
Specificaton of the key - That's what I'm trying to find. The environment
variable PATH has been with us since DOS 2.0, but I cannot find anywhere on
MSDN or Microsoft sites anything about it - how to correctly formulate it.
Yes, it consists of a series of one or more fully-qualified path names,
separated by semicolons. What is not stated anywhere is the use of
terminating '\', and in the case of a few recently seen cases, a terminating
'\.' Inquirring minds want to know.

For the path statement, as far as I know, these three methods give you the same
effect. It's just three different ways to specify a path.

And is there a limit to how long the
path variable can be? I've seen a couple cryptic references to a 128
character limit - is that for real, and still applicable to Win2k/XP?

It's at least 1023 in Win2k/WinXP.


I always use the command line utility Pathman.exe to modify on the path
programmatically. It will e.g. handle repeated entries correctly.

Here is the one from the free part of the Windows 2000 Resource kit (It works on
WinXP and Win Nt 4.0 as well):

Download Pathman.exe from here:
http://www.microsoft.com/windows2000/techinfo/reskit/tools/default.asp

Run pathman /? in a command prompt for more help...


It's in the Windows Server 2003 Resource Kit Tools as well:
http://www.microsoft.com/downloads/...69-57ff-4ae7-96ee-b18c4790cffd&DisplayLang=en

Will install on WinXP or later.
 
T

Torgeir Bakken (MVP)

VManes said:
I'm just a little amazed and miffed that nowhere I've searched (MS, rest of
'net, 25K+pages of books) can I find a specification of formatting the path
variable, beyond what was said back in DOS 2.0. And can't find any
statement on the default environment size for XP, or limits on environment
variable length. Anecdotal evidence suggests variously 127, 255, 1023,
4097. Can a variable extend to fill the curent environment space? Is the
32K limit on environment (at least in Win9x) still valid?

Hi

For 32-bit applications, the environment dynamically grows
to whatever size it needs to be.

I think the length limit of a environment variable is 2040 characters.

See this thread for a discussion on the length limit:
http://groups.google.com/groups?hl=...8&oe=UTF-8&selm=uDlTKhm4BHA.568%40tkmsftngp05
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top