registry question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    registry question

    Hi all
    I am retrieving the value of the Environment path variable
    from registry key
    HKEY_LOCAL_MACH INE\System\Curr entControlSet\C ontrol\Sessio
    n Manager\Environ ment

    I notice that there is also other keys like
    ControlSet001, ControlSet002 etc. What is the difference
    between all these?

    Is using the CurrentControlS et key the most reliable?
    Thanks for all your valuable replies.

  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: registry question

    You shouldn't use the registry. Rather, use the static
    GetEnvironmentV ariable method on the Environment class.

    The ControlSet001, etc, etc keys are for other boot configurations that
    are on your system.

    Hope this helps.


    --
    - Nicholas Paldino [.NET/C# MVP]
    - mvp@spam.guard. caspershouse.co m


    <anonymous@disc ussions.microso ft.com> wrote in message
    news:50ad01c4c7 42$185ec710$a60 1280a@phx.gbl.. .[color=blue]
    > Hi all
    > I am retrieving the value of the Environment path variable
    > from registry key
    > HKEY_LOCAL_MACH INE\System\Curr entControlSet\C ontrol\Sessio
    > n Manager\Environ ment
    >
    > I notice that there is also other keys like
    > ControlSet001, ControlSet002 etc. What is the difference
    > between all these?
    >
    > Is using the CurrentControlS et key the most reliable?
    > Thanks for all your valuable replies.
    >[/color]


    Comment

    • Guest's Avatar

      #3
      Re: registry question

      Thanks Nicholas. I need to change the Path variable and
      set it to some other value programmaticall y. There is
      no .NET method for that. So, I am modifying the registry
      key programmaticall y. Any other ideas?
      [color=blue]
      >-----Original Message-----
      > You shouldn't use the registry. Rather, use the[/color]
      static[color=blue]
      >GetEnvironment Variable method on the Environment class.
      >
      > The ControlSet001, etc, etc keys are for other boot[/color]
      configurations that[color=blue]
      >are on your system.
      >
      > Hope this helps.
      >
      >
      >--
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      >
      ><anonymous@dis cussions.micros oft.com> wrote in message
      >news:50ad01c4c 742$185ec710$a6 01280a@phx.gbl. ..[color=green]
      >> Hi all
      >> I am retrieving the value of the Environment path[/color][/color]
      variable[color=blue][color=green]
      >> from registry key
      >>[/color][/color]
      HKEY_LOCAL_MACH INE\System\Curr entControlSet\C ontrol\Sessio[color=blue][color=green]
      >> n Manager\Environ ment
      >>
      >> I notice that there is also other keys like
      >> ControlSet001, ControlSet002 etc. What is the[/color][/color]
      difference[color=blue][color=green]
      >> between all these?
      >>
      >> Is using the CurrentControlS et key the most reliable?
      >> Thanks for all your valuable replies.
      >>[/color]
      >
      >
      >.
      >[/color]

      Comment

      • Nicholas Paldino [.NET/C# MVP]

        #4
        Re: registry question

        In .NET 1.1 and before, you would want to call the
        SetEnvironmentV ariable API function through the P/Invoke layer.

        In .NET 2.0 a static SetEnvironmentV ariable method was attached to the
        Environment class.


        --
        - Nicholas Paldino [.NET/C# MVP]
        - mvp@spam.guard. caspershouse.co m

        <anonymous@disc ussions.microso ft.com> wrote in message
        news:493b01c4c7 46$ee7500e0$a40 1280a@phx.gbl.. .[color=blue]
        > Thanks Nicholas. I need to change the Path variable and
        > set it to some other value programmaticall y. There is
        > no .NET method for that. So, I am modifying the registry
        > key programmaticall y. Any other ideas?
        >[color=green]
        >>-----Original Message-----
        >> You shouldn't use the registry. Rather, use the[/color]
        > static[color=green]
        >>GetEnvironmen tVariable method on the Environment class.
        >>
        >> The ControlSet001, etc, etc keys are for other boot[/color]
        > configurations that[color=green]
        >>are on your system.
        >>
        >> Hope this helps.
        >>
        >>
        >>--
        >> - Nicholas Paldino [.NET/C# MVP]
        >> - mvp@spam.guard. caspershouse.co m
        >>
        >>
        >><anonymous@di scussions.micro soft.com> wrote in message
        >>news:50ad01c4 c742$185ec710$a 601280a@phx.gbl ...[color=darkred]
        >>> Hi all
        >>> I am retrieving the value of the Environment path[/color][/color]
        > variable[color=green][color=darkred]
        >>> from registry key
        >>>[/color][/color]
        > HKEY_LOCAL_MACH INE\System\Curr entControlSet\C ontrol\Sessio[color=green][color=darkred]
        >>> n Manager\Environ ment
        >>>
        >>> I notice that there is also other keys like
        >>> ControlSet001, ControlSet002 etc. What is the[/color][/color]
        > difference[color=green][color=darkred]
        >>> between all these?
        >>>
        >>> Is using the CurrentControlS et key the most reliable?
        >>> Thanks for all your valuable replies.
        >>>[/color]
        >>
        >>
        >>.
        >>[/color][/color]


        Comment

        Working...