Re: Is it possible to use %SystemRoot% in code
- From: "Ivar" <ivar.ekstromer000@xxxxxxxxxxxx>
- Date: Sun, 23 Jul 2006 00:13:55 GMT
Is it possible to use %SystemRoot% in code i.e. automatically converts to
the
Window system folder (different depending on the Windows OS version)? If
it
is possible, how is it implemement (code snippet would help)?
Taken directly from API-Guide
Private Declare Function GetSystemDirectory Lib "kernel32" Alias _
"GetSystemDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As Long
Private Sub Form_Load()
'KPD-Team 1998
'URL: http://www.allapi.net/
'E-Mail: KPDTeam@xxxxxxxxxx
Dim sSave As String, Ret As Long
'Create a buffer
sSave = Space(255)
'Get the system directory
Ret = GetSystemDirectory(sSave, 255)
'Remove all unnecessary chr$(0)'s
sSave = Left$(sSave, Ret)
'Show the windows directory
MsgBox "Windows System directory: " + sSave
End Sub
.
- Follow-Ups:
- Re: Is it possible to use %SystemRoot% in code
- From: MikeD
- Re: Is it possible to use %SystemRoot% in code
- Prev by Date: Re: How can I test to see if a DLL is registered or not?
- Next by Date: Re: Is it possible to use %SystemRoot% in code
- Previous by thread: Re: Word Automation for Check Printing
- Next by thread: Re: Is it possible to use %SystemRoot% in code
- Index(es):
Relevant Pages
|