PC Review


Reply
Thread Tools Rate Thread

Accesssing environment variables from resgistry export

 
 
Fred Ma
Guest
Posts: n/a
 
      12th Jun 2004
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
--
Fred Ma
Dept. of Electronics, Carleton University
Ottawa, Ontario, Canada
 
Reply With Quote
 
 
 
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      12th Jun 2004

"Fred Ma" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
> --
> Fred Ma
> Dept. of Electronics, Carleton University
> Ottawa, Ontario, Canada


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

set > c:\EnvVariables.txt


 
Reply With Quote
 
Fred Ma
Guest
Posts: n/a
 
      12th Jun 2004
"Pegasus (MVP)" wrote:
>
> > 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?

>
> 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.
--
Fred Ma
Dept. of Electronics, Carleton University
Ottawa, Ontario, Canada
 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      12th Jun 2004

"Fred Ma" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Pegasus (MVP)" wrote:
> >
> > > 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?

> >
> > 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.
> --
> Fred Ma
> Dept. of Electronics, Carleton University
> Ottawa, Ontario, Canada


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


 
Reply With Quote
 
Fred Ma
Guest
Posts: n/a
 
      12th Jun 2004
"Pegasus (MVP)" wrote:
>
> 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
--
Fred Ma
Dept. of Electronics, Carleton University
Ottawa, Ontario, Canada
 
Reply With Quote
 
George Hester
Guest
Posts: n/a
 
      12th Jun 2004
Not using regedit.

--
George Hester
__________________________________
"Fred Ma" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> "Pegasus (MVP)" wrote:
> >
> > 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
> --
> Fred Ma
> Dept. of Electronics, Carleton University
> Ottawa, Ontario, Canada

 
Reply With Quote
 
nospam
Guest
Posts: n/a
 
      12th Jun 2004
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.

George Hester wrote:
>
> Not using regedit.
>
> --
> George Hester
> __________________________________
> "Fred Ma" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> > "Pegasus (MVP)" wrote:
> > >
> > > 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
> > --
> > Fred Ma
> > Dept. of Electronics, Carleton University
> > Ottawa, Ontario, Canada

 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      12th Jun 2004
Fred Ma wrote:

> 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


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/com...r/default.mspx
 
Reply With Quote
 
Torgeir Bakken \(MVP\)
Guest
Posts: n/a
 
      12th Jun 2004
nospam wrote:

> 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.


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/com...r/default.mspx
 
Reply With Quote
 
Fred Ma
Guest
Posts: n/a
 
      12th Jun 2004
"Torgeir Bakken (MVP)" wrote:
>
>
> 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
--
Fred Ma
Dept. of Electronics, Carleton University
Ottawa, Ontario, Canada
 
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
Environment Variables =?Utf-8?B?WmFjaA==?= Windows XP General 7 2nd May 2006 01:26 AM
Environment variables Xarky Windows XP Basics 2 14th Dec 2004 01:02 AM
Environment Variables crash_sc Windows XP Help 0 7th Sep 2004 07:19 PM
environment variables dude Microsoft Windows 2000 Active Directory 1 4th Aug 2003 01:19 PM
User Environment variables overriden by system env variables Bonny Windows XP Setup 0 11th Jul 2003 06:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:53 PM.