Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Sub Command1_Click()
Dim path As String
Dim ret As Long
path = Space$(255)
ret = GetWindowsDirectory(path, 255)
path = Left$(path, ret)
path = path & "\notepad.exe" ' this is just to get the notepad path
' use this call instead of standard Shell function
Module1.ShellIt (path)
End Sub