How can I get %windir ? 
Author Message
 How can I get %windir ?

Hi!

In DOS I obtain the windows path calling %windir... there's a VB routine or
some function or API call to obtain that info?

Thanks!



Fri, 16 Jul 2004 21:20:14 GMT  
 How can I get %windir ?
On Mon, 28 Jan 2002 08:20:14 -0500, "Andrs Giraldo"

Quote:

>Hi!

>In DOS I obtain the windows path calling %windir... there's a VB routine or
>some function or API call to obtain that info?

Use the FileSystemObject in the Scripting library:

Dim oFS As New Scripting.FileSystemObject
Dim oF As Scripting.Folder

    Set oF = oFS.GetSpecialFolder(SystemFolder)
    MsgBox "System folder = " & oF.Path
    Set oF = Nothing

    Set oF = oFS.GetSpecialFolder(TemporaryFolder)
    MsgBox "Temp folder = " & oF.Path
    Set oF = Nothing

    Set oF = oFS.GetSpecialFolder(WindowsFolder)
    MsgBox "Windows folder = " & oF.Path
    Set oF = Nothing

Or call the SHGetSpecialFolderLocation API (never tried it, but it is
the recommended method)

According to this post:
http://groups.google.com/groups?hl=en&threadm=UKJt5.11073%24cr3.31487...

by Bill McCarthy, the sample source is available here:

http://download.microsoft.com/download/vb60ent/Sample17/1/W9XNT4/EN-U...

James

--
I do not own any hippos.  But they do sometimes stray into my email
address.
Remove them to email me.



Fri, 16 Jul 2004 22:02:06 GMT  
 How can I get %windir ?
The GetWindowsDirectory function retrieves the path of the Windows
directory.

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As
Long

Dim Path as String, strSave as string
'Create a buffer string
strSave = String(200, Chr$(0))
Path = GetWindowsDirectory(strSave, Len(strSave))
--
Best regards
                 Marcos


Quote:
> Hi!

> In DOS I obtain the windows path calling %windir... there's a VB routine
or
> some function or API call to obtain that info?

> Thanks!



Fri, 16 Jul 2004 23:23:55 GMT  
 How can I get %windir ?
anybody remember ENVIRON function in VB?


Quote:
> Hi!

> In DOS I obtain the windows path calling %windir... there's a VB routine
or
> some function or API call to obtain that info?

> Thanks!



Sat, 17 Jul 2004 02:53:45 GMT  
 How can I get %windir ?
Environ({envstring | number})
ex:
Environ("windir")
regards
Marcos

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Sat, 17 Jul 2004 04:10:08 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Getting WINDIR in VB4 ??

2. Getting WinDir

3. VBScript for Webpage-How do I test for a file using %windir%\

4. Windir in VB

5. How to get windows directory on computer? (%windir%/)

6. %windir%, %defaultdir% etc

7. How do I create a canned form?

8. Canned AcctReceivable Module needed!

9. Canned pages....

10. Cans access2.0 engine access btrieve files?

11. Crystal Reports Canned Code

12. Canned objects and/or images

 

 
Powered by phpBB® Forum Software