I would like to how to get the path of the system32,cuz it's not aleays the same.
Printable View
I would like to how to get the path of the system32,cuz it's not aleays the same.
It will always be under windows.
Code:'find the windows directory path
'usefull in shell commands if you know something
'is in the windows directory
'example..instead of shell c:\windows\notepad.ext
'you could use shell windir$ & /notepad.exe
'if windows was stored in E:/Windows then you wouldn't get an error
'if you used shell c:/windosw\notepad.exe, it couldn't be found '(error)
'
Option Explicit
Private Declare Function GetWindowsDirectory _
Lib "kernel32" Alias "GetWindowsDirectoryA" _
(ByVal lpBuffer As String, ByVal nSize As Long) As Long
'
Private Sub Form_Load()
'
Dim strFindWinDir$, WinDir$
'
WinDir$ = Space(144)
strFindWinDir$ = GetWindowsDirectory(WinDir$, 144)
WinDir$ = Trim(WinDir$)
'
MsgBox "The Windows Directory Path is: " & WinDir$
'
End Sub
Thanks again HeSaidJoe,
don't know what i do without you!!!!!!!!