How can I read out the current installation and WINDOWS\SYSTEM path 
Author Message
 How can I read out the current installation and WINDOWS\SYSTEM path

Hi !

Does anybody know how can I read out the current WINDOWS\SYSTEM- Path and
the installation path which the user choosed ?

I've had an API which did that by using the Lib "Kernel". But under VB50 it
doesn't work.

Does anybody know a new reason for VB 50 ?

Thomas



Fri, 15 Sep 2000 03:00:00 GMT  
 How can I read out the current installation and WINDOWS\SYSTEM path

App.Path will tell you the directory that your app is run from, or you could
have your setup program write the installation path to the registry.

Use the API to get the Windows directory and System directory:

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

Public Function GetWinDir() as string
    Dim sBuffer as string, lReturnLen as long
    sBuffer = string(MAX_PATH, vbNullChar)        'MAX_PATH is 260
    lReturnLen = GetWindowsDirectory(sBuffer, Len(sBuffer))
    GetWinDir = Left$(sBuffer, lReturnLen) & "\"
End Function

Do the same thing for the system directory but change GetWindowsDirectory to
GetSystemDirectory

Scott Bailey



Fri, 15 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ADSI:GetObject network path not found reading info other than the current computer name

2. Windows Service Current Path

3. Current windows path

4. How do I get the Windows System path?

5. Setting the path to the path of the current application

6. How to make setup disk to install .exe to windows system path

7. Windows System path

8. Getting Windows system path

9. VB4 and Windows System Path

10. Enforce using DLL at specified path rather than at System path

11. Expanding SYSTEM %PATH% with embedded SYSTEM environment variable problem

12. Presentation, Demonstrations or Installation on Windows, Windows NT

 

 
Powered by phpBB® Forum Software