Q: Create File in windows-directory
Sailor@aceinfo.com
A: make use of the API call GetWindowsDirectory.
Declare Function GetWindowsDirectory Lib "kernel32" Alias _
"GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) _
As Long
'make on the same module-form a global variable
Global windir$
put in your form_load event the next code:
Dim Buffer$, res&
' Get windowsdirectory
buffer$ = Space(255)
ret& = GetWindowsDirectory(buffer, 255)
windir$ = Left$(buffer$, ret&)
That's all to do: in the variable windir$ is now the local
windows-directory. So to open a file you do:
Open windir$ & "\networks.txt" For Output as #1
Return