How to 'GetWindowsDirectory' in c#

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hans

    How to 'GetWindowsDirectory' in c#

    Hi,

    can anybody tell me how to get the windows directory in
    C#???

    Tanx for any hint,
    Hans.
  • Konrad Neitzel

    #2
    Re: How to 'GetWindowsDire ctory' in c#

    Hi Hans!

    "Hans" <anonymous@disc ussions.microso ft.com> schrieb im Newsbeitrag
    news:058101c3ac d9$810c6620$a10 1280a@phx.gbl.. .
    [color=blue]
    > can anybody tell me how to get the windows directory in
    > C#???[/color]

    Just have a closer Look at the Class Environment.
    The Environment Variable is SystemRoot, so you can use
    Environment.Get EnvironmentVari able("SystemRoo t")

    With kind regards,

    Konrad


    Comment

    • Hans

      #3
      Re: How to 'GetWindowsDire ctory' in c#

      That works alright! Thanx.

      Can you tell me the difference between 'Systemroot'
      and 'Windir'?

      Is parameter 'Systemroot' (or 'windir') ALWAYS set?

      Is it possible for the current user not to have
      EnvironmentPerm ission with Read access?

      best regards,
      Hans
      [color=blue]
      >-----Original Message-----
      >Hi Hans!
      >
      >"Hans" <anonymous@disc ussions.microso ft.com> schrieb im[/color]
      Newsbeitrag[color=blue]
      >news:058101c3a cd9$810c6620$a1 01280a@phx.gbl. ..
      >[color=green]
      >> can anybody tell me how to get the windows directory in
      >> C#???[/color]
      >
      >Just have a closer Look at the Class Environment.
      >The Environment Variable is SystemRoot, so you can use
      >Environment.Ge tEnvironmentVar iable("SystemRo ot")
      >
      >With kind regards,
      >
      >Konrad
      >
      >
      >.
      >[/color]

      Comment

      • Konrad Neitzel

        #4
        Re: How to 'GetWindowsDire ctory' in c#

        Hi Hans!

        "Hans" <anonymous@disc ussions.microso ft.com> schrieb im Newsbeitrag
        news:56a401c3ac e8$a02dc490$a60 1280a@phx.gbl.. .
        [color=blue]
        > Can you tell me the difference between 'Systemroot'
        > and 'Windir'?[/color]

        No - sorry. But in the registry, I always see %SystemRoot% and not
        %windir% (Win XP Home). But %windir% is also defined!
        [color=blue]
        > Is parameter 'Systemroot' (or 'windir') ALWAYS set?[/color]
        Yes I think so, because it is commonly used by microsoft. (On Win NT
        based systems, but the .NET Framework isn't available for Win 9x/ME, so
        that shouldn't matter - or am I wrong?)
        [color=blue]
        > Is it possible for the current user not to have
        > EnvironmentPerm ission with Read access?[/color]

        Hmm ... normaly all users should have these rights. In the moment, I
        cannot emagine such a constelation, but maybe it is possible with
        policies to regret users that right. But of course: There variables
        could be changed. But I see no reason, why somebody changes these
        variables.

        With kind regards,

        Konrad


        Comment

        Working...