System Root directory

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

Any ideas on how to determine what version of windows is
being run, and what the system root directory is?

e.g. c:\winnt OR c:\windows etc.

Thanks

Jack
 
Hi Jack

Environ("windir") will return the windows directory

and

Application.OperatingSystem will return the version of windows

eg msgbox(environ("windir"))
or msgbox(application.operatingsystem)

HTH

David
 
... the system root directory is?

Would any ideas here help?

Sub Demo()
Const WindowsFolder = 0
Const SystemFolder = 1
Const TemporaryFolder = 2

With CreateObject("Scripting.FileSystemObject")
Debug.Print .GetSpecialFolder(WindowsFolder)
Debug.Print .GetSpecialFolder(SystemFolder)
Debug.Print .GetSpecialFolder(TemporaryFolder)
End With
End Sub
 
Jack,

Sub test()
MsgBox (Environ("WINDIR") & _
Application.PathSeparator & _
IIf(InStr(1, Application.OperatingSystem, "32"), "System32",
"System"))
End Sub

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top