How to find path for windows folder?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can I find path of windows folder using vb.net? It could be winnt or
windows depending upon the os.

System.Environment.SpecialFolder enumeration does not have a constant for
windows folder.
 
By "navigate" I simply mean that once you have the path to the system
folder, you could then remove the right most folder to get the path to the
Windows folder, either by direct string manipulation of the path, or using
the Path class. This assumes that the system folder is under the Windows
folder, which I never seen it otherwise.
 
Have tried executing the internal set command in a command prompt? Does any
of the environment variables listed show the Windows folder?
 
Then get it from registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion | SystemRoot
 
Back
Top