ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   System Root directory (https://www.excelbanter.com/excel-programming/288734-system-root-directory.html)

Jack

System Root directory
 
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

David Coleman[_3_]

System Root directory
 
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


"Jack" wrote in message
...
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




Dana DeLouis[_3_]

System Root directory
 
... 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

--
Dana DeLouis
Using Windows XP & Office XP
= = = = = = = = = = = = = = = = =


"Jack" wrote in message
...
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




Rob van Gelder[_4_]

System Root directory
 
Jack,

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

Rob

"Jack" wrote in message
...
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





All times are GMT +1. The time now is 10:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com