PC Review


Reply
Thread Tools Rate Thread

How to append PATH to registry ?

 
 
codefixer@gmail.com
Guest
Posts: n/a
 
      16th Mar 2005
Hi,

I am wondering how can I append path to existing path in the registry.
I want to add d:\tools for the PATH variable in
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment]


Thanks.

 
Reply With Quote
 
 
 
 
Dave Patrick
Guest
Posts: n/a
 
      16th Mar 2005
setx.exe from the resource kit.


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

<(E-Mail Removed)> wrote:
| Hi,
|
| I am wondering how can I append path to existing path in the registry.
| I want to add d:\tools for the PATH variable in
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
| Manager\Environment]
|
|
| Thanks.
|


 
Reply With Quote
 
codefixer@gmail.com
Guest
Posts: n/a
 
      16th Mar 2005

Dave Patrick wrote:
> setx.exe from the resource kit.


Unfortunately I won't have it. I tried the following

In a batch file, set path=d:\tools;%path% and then dump this to a reg
file.
Then call the reg file. For some reason, it still doesn't get
imported.(I click Yes when it prompts me)
My reg file looks like this

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment]
"Path"="d:\tools;D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32"

Any idea why Path would not get appended into the registry ?

Thanks

>
>
> --
> Regards,
>
> Dave Patrick ....Please no email replies - reply in newsgroup.
> Microsoft Certified Professional
> Microsoft MVP [Windows]
> http://www.microsoft.com/protect
>
> <(E-Mail Removed)> wrote:
> | Hi,
> |
> | I am wondering how can I append path to existing path in the

registry.
> | I want to add d:\tools for the PATH variable in
> | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
> | Manager\Environment]
> |
> |
> | Thanks.
> |


 
Reply With Quote
 
Dave Patrick
Guest
Posts: n/a
 
      16th Mar 2005
That would probably replace "Path" with a type Reg_Sz string. "Path" needs
to be type Reg_Expand_Sz hence it is stored as an array of hex values in a
*.reg file.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

<(E-Mail Removed)> wrote:
|
| Unfortunately I won't have it. I tried the following
|
| In a batch file, set path=d:\tools;%path% and then dump this to a reg
| file.
| Then call the reg file. For some reason, it still doesn't get
| imported.(I click Yes when it prompts me)
| My reg file looks like this
|
| Windows Registry Editor Version 5.00
|
| [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
| Manager\Environment]
| "Path"="d:\tools;D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System32"
|
| Any idea why Path would not get appended into the registry ?
|
| Thanks


 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      17th Mar 2005
In microsoft.public.win2000.registry wrote:

>
> Dave Patrick wrote:
>> setx.exe from the resource kit.

>
> Unfortunately I won't have it. I tried the following
>
> In a batch file, set path=d:\tools;%path% and then dump this to
> a reg file.
> Then call the reg file. For some reason, it still doesn't get
> imported.(I click Yes when it prompts me)
> My reg file looks like this
>
> Windows Registry Editor Version 5.00
>
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
> Manager\Environment]
> "Path"="d:\tools;D:\WINDOWS\system32;D:\WINDOWS;D:\WINDOWS\System
> 32"
>
> Any idea why Path would not get appended into the registry ?
>
> Thanks
>
>>
>>
>> --
>> Regards,
>>
>> Dave Patrick ....Please no email replies - reply in newsgroup.
>> Microsoft Certified Professional
>> Microsoft MVP [Windows]
>> http://www.microsoft.com/protect
>>
>> <(E-Mail Removed)> wrote:
>> | Hi,
>> |
>> | I am wondering how can I append path to existing path in the

> registry.
>> | I want to add d:\tools for the PATH variable in
>> | [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
>> | Manager\Environment]
>> |
>> |
>> | Thanks.


There is also pathman.exe (Resource Kit)

and how about EditPath.exe
http://internet.cybermesa.com/~bstewart/misctools.html
http://internet.cybermesa.com/~bstew...les/epath1.zip
If you cannot get ResourceKit or Support Tools but 3rd-party is okay,
then try editpath. Far easier than direct registry manipulation via
..REG files for this task.

Or you might use reg.exe in a script perhaps.

You may have an additional problem in batch by not having escaped the
"%" sybols with "^".
 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      17th Mar 2005
On 16 Mar 2005 09:35:47 -0800, (E-Mail Removed) wrote:

>Hi,
>
>I am wondering how can I append path to existing path in the registry.
>I want to add d:\tools for the PATH variable in
>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
>Manager\Environment]
>
>
>Thanks.


See tips 4263 and 8840 in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Reply With Quote
 
NoneOfBusiness
Guest
Posts: n/a
 
      30th Mar 2005
On Thu, 17 Mar 2005 09:10:36 -0500, Jerold Schulman <(E-Mail Removed)>
wrote:

>On 16 Mar 2005 09:35:47 -0800, (E-Mail Removed) wrote:
>
>>Hi,
>>
>>I am wondering how can I append path to existing path in the registry.
>>I want to add d:\tools for the PATH variable in
>>[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
>>Manager\Environment]
>>
>>
>>Thanks.

>
>See tips 4263 and 8840 in the 'Tips & Tricks' at http://www.jsiinc.com
>
>Jerold Schulman
>Windows Server MVP
>JSI, Inc.
>http://www.jsiinc.com



I did it an ugly way but effective. I used vbscript to capture the
contents of the current value. I then appended the new value to it and
wrote it back

'************************************************************
'* Modifying The System Path With New Entries *
'************************************************************
Dim ExistingPath, NewPath
Set oShell = WScript.CreateObject("WScript.Shell")
Set oEnv = oShell.Environment("SYSTEM")

'************************************************************
'* Add your Path Entry Here *
'************************************************************
ExistingPath = oEnv("PATH")
NewPath = ExistingPath & ";" & "C:\ADD SOME PATH HERE"
oEnv("PATH") = NewPath 'WRITE NEW PATH, INCLUDING OLD ONE

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to append PATH to registry ? codefixer@gmail.com Microsoft Windows 2000 Registry 6 30th Mar 2005 01:22 AM
Windows Installer: Registry path + Fixed path MW Microsoft Dot NET Framework 2 5th Mar 2005 08:09 PM
Windows Installer: Registry path + Fixed path MW Microsoft Dot NET 0 4th Mar 2005 03:24 PM
trying to append to our current PATH Mfitzge9 AT nycap DOT rr DOT com Microsoft Windows 2000 CMD Promt 5 6th Feb 2004 08:29 PM
Append to path statement Michael Microsoft Windows 2000 CMD Promt 10 15th Dec 2003 09:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:54 PM.