Re: Mapping drives and adding to the path
From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 05/25/04
- Next message: Iain M: "Re: Mapping drives and adding to the path"
- Previous message: tt: "Script for User rights assignment"
- In reply to: Niclas Lindblom: "Re: Mapping drives and adding to the path"
- Next in thread: Iain M: "Re: Mapping drives and adding to the path"
- Reply: Iain M: "Re: Mapping drives and adding to the path"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 May 2004 02:53:43 -0700
Please be absolutely certain that the PATH registry key stay as
REG_EXPAND_SZ or else the %environment-variables% won't resolve, and PATH
behavior will appear broken.
You will need to run with the elevated privileges of the Group Policy login
script instead of the logged-on user to make these modifications.
--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Niclas Lindblom" <nospam.lindblom_niclas@hotmail.com> wrote in message
news:ugZRBUZQEHA.3380@TK2MSFTNGP11.phx.gbl...
You are right, the value is store in the registry in the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment\PATH
as an expandable string value
Perhaps you can use the REG command to manipulate this key (belive this
comes with the resource kit), or the shell object if you want to use VB
script.
Here is a sample on how to add a folder to the path using VB Script:
'##SCRIPT START
Dim oShell
Dim oEnvironment
Dim sCurValue
Set oShell=CreateObject("wscript.shell")
sCurValue=oShell.Environment.Item("PATH")
Set oEnvironment=oShell.Environment("System")
oEnvironment("PATH")=sCurvalue & ";c:\myNewPath"
'##SCRIPT END
Also looks like you can do this the old style way in Autoexec.bat, according
to: http://support.microsoft.com/?kbid=100843
Regards
Niclas
<anonymous@discussions.microsoft.com> wrote in message
news:1162301c4418c$3567abb0$a501280a@phx.gbl...
>I have tried that method, but it only works for the
> command prompt sessions that it is run within. If I run
> another command prompt, the PATH has not been added to.
> Is there a method to add to the 'system' PATH variable.
>
> I believe that's stored in the registry, but the users
> logging on do not have rights to modify that part of the
> registry.
>
> Iain
>
>>-----Original Message-----
>>the command from a commandline to add environment
> variables is SET. type SET
>>/? for options. I am not aware of a way to test group
> membership from a
>>commanline script, but you might be able to find a 3rd
> party utility to do
>>this, or use VB scripts instead for more flexibility.
>>
>>Good luck
>>
>>Niclas Lindblom
>>
>>
>>"Iain M" <anonymous@discussions.microsoft.com> wrote in
> message
>>news:112de01c4417f$6b659d10$a301280a@phx.gbl...
>>> I'm migrating from Netware to Windows 2003, and I have a
>>> couple of questions about login scripts. I'm using
> a .BAT
>>> file deployed using group policy.
>>>
>>> - I can map drives using NET USE in the group policy
> login
>>> script. How can I add a network drive to the PATH ?
>>>
>>> - how do I test if a user is a member of an Active
>>> Directory group ?
>>>
>>> Any help appreciated.
>>>
>>> Iain
>>
>>
>>.
>>
- Next message: Iain M: "Re: Mapping drives and adding to the path"
- Previous message: tt: "Script for User rights assignment"
- In reply to: Niclas Lindblom: "Re: Mapping drives and adding to the path"
- Next in thread: Iain M: "Re: Mapping drives and adding to the path"
- Reply: Iain M: "Re: Mapping drives and adding to the path"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|