|
|
Title | Find the Windows directory without using the API |
Description | This example shows how to find the Windows directory without using the API in Visual Basic 6. It reads the file C:\MSDOS.SYS and looks for the windir= assignment. |
Keywords | Windows directory, Windows, WinDir |
Categories | Software Engineering, Files and Directories, API |
|
|
Thanks to Pablo Handler.
The prorgam opens the file C:\MSDOS.SYS and looks for the windir= assignment.
|
|
Private Sub Form_Load()
Dim FF As Integer
Dim LINE As String
FF = FreeFile
Open "C:\MSDOS.SYS" For Input As FF
Do
Line Input #FF, LINE
Loop While InStr(1, LCase$(LINE), "windir=", 1) = 0
Close FF
Label2.Caption = Mid(LINE, 8)
End Sub
|
|
|
|
|
|