Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Get Windows System directory [modified]

Get Windows System directory [modified]

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    freshonlineMax
    wrote on last edited by
    #1

    Hi I want to get windows system directory? I have to save some files there and then access to them. Please help me. -- modified at 2:22 Monday 4th September, 2006

    A N S 3 Replies Last reply
    0
    • F freshonlineMax

      Hi I want to get windows system directory? I have to save some files there and then access to them. Please help me. -- modified at 2:22 Monday 4th September, 2006

      A Offline
      A Offline
      abhinish
      wrote on last edited by
      #2

      hi! i think u r looking for this.. string WinDir = System.Environment.GetEnvironmentVariable("windir");

      abhinav

      1 Reply Last reply
      0
      • F freshonlineMax

        Hi I want to get windows system directory? I have to save some files there and then access to them. Please help me. -- modified at 2:22 Monday 4th September, 2006

        N Offline
        N Offline
        Nader Elshehabi
        wrote on last edited by
        #3

        Hello

        string SystemPath = Environment.GetFolderPath(Environment.SpecialFolder.System);

        Regards:rose:

        1 Reply Last reply
        0
        • F freshonlineMax

          Hi I want to get windows system directory? I have to save some files there and then access to them. Please help me. -- modified at 2:22 Monday 4th September, 2006

          S Offline
          S Offline
          Scott Dorman
          wrote on last edited by
          #4

          It isn't recommended to save files in the system directory and running under Vista it isn't allowed unless you are running with specific elevated privileges (usually only given to installer apps.) The correct way to find it is Environment.GetFolderPath(Environment.SpecialFolder.System)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups