Append to path statement

M

Michael

I have two search drives that are network drives. I'd
like to append to the user's path when they login via a
login script to contain those drives. I'm having trouble
doing this...if anyone has any advice I'd appreciate it.

Thank you.
 
R

Ray at

Use the %USERNAME% variable.

Examples:
net use q: \\server\share\%username%
net use j: \\server\%username%

Ray at work
 
J

Jerold Schulman

Specifically what I would like to do is have something in
the login script that would, for example add X:\;Y:\ to
the path on the workstation.

IF the path now contains, C:\windows\;c:\windows\system32;

I would like it to contain
C:\windows\;c:\windows\system32;x:\;y:\ -- adding x:\ and
Y:\ via a login script when the user logs in.
Use the Setx freeware at tip 3739 in the 'Tips & Tricks' at
http://www.jsiinc.com to make it persistent beyond the
script CMD session.




Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
G

Guest

That seems to work but only for the NTVD in which the
script runs.

In other words, this addition to the path does not
persist to the actual Windows environment where I need
this available.

Any ideas?
 
M

Michael

setenv.exe works great for replacing the path with
something else, but I really want to keep the path that
already exists, and simply append to it when someone logs
in, and not have those addtions to the path persist when
someone who does not have a login script assigned to them
logs in. Do you know if this tool can do that?

This was possible with Netware, which I am migrating away
from, and am hoping I can do the same thing with Windows.

-----Original Message-----
 
J

Jerold Schulman

You could try using the APPEND command, tip 3462 in the 'Tips & Tricks' at
http://www.jsiinc.com


setenv.exe works great for replacing the path with
something else, but I really want to keep the path that
already exists, and simply append to it when someone logs
in, and not have those addtions to the path persist when
someone who does not have a login script assigned to them
logs in. Do you know if this tool can do that?

This was possible with Netware, which I am migrating away
from, and am hoping I can do the same thing with Windows.

-----Original Message-----


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
M

Mark V

In said:
setenv.exe works great for replacing the path with
something else, but I really want to keep the path that
already exists, and simply append to it when someone logs
in, and not have those addtions to the path persist when
someone who does not have a login script assigned to them
logs in. Do you know if this tool can do that?

This was possible with Netware, which I am migrating away
from, and am hoping I can do the same thing with Windows.

SETX can write a User environment value (as opposed to the System
(machine) environment making it User-specific. This will however be
a persistent value for that user.

Perhaps a local batch that tests for mapped drives after logon script
has run, then issues a modification using PATHMAN.EXE from the
resource Kit... Pathman can _append_ to the User PATH.

Possibly you need to place all existing PATH elements in System and
use User PATH only (replace it) for this to work out well.

 
A

Al Dunbar [MS-MVP]

Hmmm, a few red herrings in this thread, no? The problem was not,
apparently, to modify the path variable, but to also make it persistent.
Quite a different thing.

As to using a tool such as setenv to set an environment variable, that gives
you the capability to simply add to it, i.e.:

path %path%;V:\;y:\
setenv path=%path% (or whatever the syntax).

/Al
 
M

Mark V

In microsoft.public.win2000.cmdprompt.admin Al Dunbar [MS-MVP]
wrote:
Hmmm, a few red herrings in this thread, no? The problem was not,
apparently, to modify the path variable, but to also make it
persistent. Quite a different thing.

As to using a tool such as setenv to set an environment variable,
that gives you the capability to simply add to it, i.e.:

path %path%;V:\;y:\
setenv path=%path% (or whatever the syntax).

Good point.
.... until the next logon...appended util max-length eventually exceeded
I should think. IIRC from a logon script.

Not certain I ever fully understood the problem to be resolved in the
first place. ;-)

If
modify PATH from logon script.
dynamically alter path to include certain mapped drives
...

and the OP has only been back once for clarification (if any)
 

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