Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Getting system directories

How can I get the path names of the "Program files" directory, the
"Windows/system32" directory, and the XLStart directory?

Thanks for your help
Fred



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Getting system directories

Fred,

This goes slightly beyond your question but gives you a way to retrieve most
common system info items. Note the last line in the sub which shows how to
refer to an item by its text identifier.

Sub ListEnvironVariables()
Dim lCounter As Long
Workbooks.Add
For lCounter = 1 To 32
Cells(lCounter, 1).Value = Environ(lCounter)
Next lCounter
Cells(33, 1) = Application.Path & "\XLStart"
Cells(34,1) = Environ("Windir") & "\System32"
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Fred" <leavemealone@home wrote in message
...
How can I get the path names of the "Program files" directory, the
"Windows/system32" directory, and the XLStart directory?

Thanks for your help
Fred





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Getting system directories

Thanks Robin, that's exactly what I needed.
Fred

"Robin Hammond" wrote in message
...
Fred,

This goes slightly beyond your question but gives you a way to retrieve
most common system info items. Note the last line in the sub which shows
how to refer to an item by its text identifier.

Sub ListEnvironVariables()
Dim lCounter As Long
Workbooks.Add
For lCounter = 1 To 32
Cells(lCounter, 1).Value = Environ(lCounter)
Next lCounter
Cells(33, 1) = Application.Path & "\XLStart"
Cells(34,1) = Environ("Windir") & "\System32"
End Sub

Robin Hammond
www.enhanceddatasystems.com

"Fred" <leavemealone@home wrote in message
...
How can I get the path names of the "Program files" directory, the
"Windows/system32" directory, and the XLStart directory?

Thanks for your help
Fred







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Getting system directories

This may not be useful, but I'd thought I'd mention it...

Sub Demo()
Dim fso As Variant

Const WindowsFolder As Long = 0
Const SystemFolder As Long = 1
Const TemporaryFolder As Long = 2

Set fso = CreateObject("Scripting.FileSystemObject")
Debug.Print fso.GetSpecialFolder(WindowsFolder)
Debug.Print fso.GetSpecialFolder(SystemFolder)
Debug.Print fso.GetSpecialFolder(TemporaryFolder)
Set fso = Nothing

End Sub

--
Dana DeLouis
Win XP & Office 2003


"Fred" <leavemealone@home wrote in message
...
How can I get the path names of the "Program files" directory, the
"Windows/system32" directory, and the XLStart directory?

Thanks for your help
Fred





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I open an Excel file on XP system, saved on a Vista system JLS7 Excel Discussion (Misc queries) 3 December 2nd 08 04:21 AM
excel causing system to be in low system resource inenewbl Excel Discussion (Misc queries) 0 April 5th 05 04:11 PM
sub directories again Shailesh Shah[_2_] Excel Programming 5 February 9th 04 09:32 PM
sub directories Mike Excel Programming 5 February 6th 04 10:15 PM
Directories Jeff[_24_] Excel Programming 4 January 20th 04 09:26 AM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"