windir

  • Thread starter Thread starter Ariel Gimenez
  • Start date Start date
A

Ariel Gimenez

Hi,
i need to know in my code where is the windows folder in c# any ideas?

Thanks in advance
 
Hi,

Not quite sure, but I suspect you could use
System.Environment.SystemDirectory and strip the system directory from
that string.

Happy coding!
Morten Wennevik [C# MVP]
 
H

The following is a C# example of how to retrieve all environment variables

IDictionary id
String sString

ArrayList values = new ArrayList()

m_env_list.Items.Clear ()
id = Environment.GetEnvironmentVariables()
foreach (DictionaryEntry myEntry in id

sString = myEntry.Key.ToString()
sString += "="
sString += myEntry.Value.ToString()
m_env_list.Items.Add(sString)


HT
Ravikanth[MVP]
 
Ariel said:
Hi,
i need to know in my code where is the windows folder in c# any
ideas?

Thanks in advance

string winfold = System.Environment.GetEnvironmemtVariable("windir");

--
Tom Porterfield
MS-MVP MCE
http://support.telop.org

Please post all follow-ups to the newsgroup only.
 
Back
Top