Accesssing environment variables from resgistry export

F

Fred Ma

Hello,

I had to reinstall windows 2000 on my Dell laptop. The support folks helped me
to save customizations in my environment variables by exporting the registry
at:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

I want to selectively cut and past snippets from the exported registry to the
panel MyComputer->Properties->Advanced->EnvironmentVariables. However, when I
open the exported registry with my favourite editor (vim), some of the entries
appear to be in double-digit hex. For example, the PATH is a series of hex
numbers separated by commas. I don't want to cut and paste that into the GUI
panel for environment variables.

Is there a way to get the text version of these environment variables?

Thanks.

Fred
 
P

Pegasus \(MVP\)

Fred Ma said:
Hello,

I had to reinstall windows 2000 on my Dell laptop. The support folks helped me
to save customizations in my environment variables by exporting the registry
at:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

I want to selectively cut and past snippets from the exported registry to the
panel MyComputer->Properties->Advanced->EnvironmentVariables. However, when I
open the exported registry with my favourite editor (vim), some of the entries
appear to be in double-digit hex. For example, the PATH is a series of hex
numbers separated by commas. I don't want to cut and paste that into the GUI
panel for environment variables.

Is there a way to get the text version of these environment variables?

Thanks.

Fred

Why bother with a registry export when you can access these same
variables from a Command Prompt environment?

set > c:\EnvVariables.txt
 
F

Fred Ma

Pegasus (MVP) said:
Why bother with a registry export when you can access these same
variables from a Command Prompt environment?

set > c:\EnvVariables.txt

It's too late for me to do that :( . I only have the registry
export from before reinstalling windows. :( :( .

Fred

P.S. Besides, I just found that "set" prints the variables in their
hard coded form. The entries in the GUI have variables in them. I
don't normally use the Command Prompt, since I more familiar with the
unix-like environment of cygwin.
 
P

Pegasus \(MVP\)

Fred Ma said:
It's too late for me to do that :( . I only have the registry
export from before reinstalling windows. :( :( .

Fred

P.S. Besides, I just found that "set" prints the variables in their
hard coded form. The entries in the GUI have variables in them. I
don't normally use the Command Prompt, since I more familiar with the
unix-like environment of cygwin.

In such a case I would write a little hex-to-character converter.
 
F

Fred Ma

Pegasus (MVP) said:
In such a case I would write a little hex-to-character converter.


In future, is there a way to export it without converting to hex?
This conversion seems to only afflict some entries.

Fred
 
G

Guest

Regedit.exe in WinXP Pro gives a save to text option on right-click on a
key. Don't know if it would work on 2000.
 
T

Torgeir Bakken \(MVP\)

Fred said:
Hello,

I had to reinstall windows 2000 on my Dell laptop. The support folks helped me
to save customizations in my environment variables by exporting the registry
at:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

I want to selectively cut and past snippets from the exported registry to the
panel MyComputer->Properties->Advanced->EnvironmentVariables. However, when I
open the exported registry with my favourite editor (vim), some of the entries
appear to be in double-digit hex. For example, the PATH is a series of hex
numbers separated by commas. I don't want to cut and paste that into the GUI
panel for environment variables.

Is there a way to get the text version of these environment variables?
Hi

This is how I would have done it:

Edit the registry file and "rename" the key path to e.g.

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\OldEnvironment

(note the 'Old' addition)

Then import the registry file. You can now use regedit.exe to obtain
the value data snippets you want to paste to MyComputer->Properties->
Advanced->EnvironmentVariables.

When you are finished, delete the 'OldEnvironment' key
 
T

Torgeir Bakken \(MVP\)

nospam said:
Regedit.exe in WinXP Pro gives a save to text option on right-click
on a key. Don't know if it would work on 2000.
Hi

Saving to a text file is not implemented in Windows 2000,
only Windows XP and later.
 
F

Fred Ma

Torgeir Bakken (MVP) said:
Edit the registry file and "rename" the key path to e.g.

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\OldEnvironment

(note the 'Old' addition)

Then import the registry file. You can now use regedit.exe to obtain
the value data snippets you want to paste to MyComputer->Properties->
Advanced->EnvironmentVariables.

When you are finished, delete the 'OldEnvironment' key


That had occured to me, but it seems like mucking with the
registry in a cavalier way. Didn't have the balls to do it.
But maybe that is being overly cautious (I don't know, as I
don't normally use the registry). After your reply, though,
I am assured that it isn't that unreasonable. Thanks.

Fred
 

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