Function GetWinDir() As String
GetWinDir = "C:\WINDOWS"
End Function
Function GetWinDir() As String
GetWinDir = Environ$("windir")
End Function
Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Function GetWinDir() As String
Dim res As String, L As Long
res = String$(255, vbNullChar)
L = GetWindowDirectory(res, Len(res))
GetWinDir = Left$(res, L)
End Function
Function GetWinDir() As String
Dim FN As Integer, L As String
ChDir "C:\"
Shell "dir win.ini /b /s >C:\lst"
FN = FreeFile
Open "C:\lst" For Input As #FN
If Not EOF(FN) Then Line Input #FN, L
Close #FN
Kill "C:\lst"
If InStr(L, "\win.ini") > 0 Then L = Left$(L, InStr(L, "\win.ini") - 1)
GetWinDir = L
End Function
Егор писал(а):ПРивет!!! Как узнать название папки. Например WINDOWS, WINNT ...
Declare Function GetWindowsDirectory Lib "kernel32" _
Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As Long
Function GetWinDir() As String
Dim a As String
Dim retSize As Long
a = String$(255, 0)
retSize = GetWindowsDirectory(a, Len(a))
a = Left$(a, retSize)
GetWinDir = a
End Function
dim GetWinFolder as New FileSystemObject
dim WinFolder as String
WinFolder=GetWinFolder.GetSpecialFolder(WindowsFolder)
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7