| Description:Gets the startup folder of your system. This version will find your startup folder no matter what Windows OS you are running, and no matter where it is installed. Declare Function SHGetSpecialFolderLocation Lib "shell32" (ByVal hwnd As Long, ByVal nFolder _ As Long, Pidl As Long) As Long Declare Function SHGetPathFromIDList Lib "shell32" (Pidl As Long, ByVal FolderPath As String) As _ Long Const CSIDL_COMMON_STARTUP = 24 Const MAX_PATH = 260 Private Function StartupMenu() As String Dim lpStartupPath As String * MAX_PATH Dim Pidl As Long Dim hResult As Long hResult = SHGetSpecialFolderLocation(0, CSIDL_COMMON_STARTUP, Pidl) If hResult = 0 Then hResult = SHGetPathFromIDList(ByVal Pidl, lpStartupPath) If hResult = 1 Then lpStartupPath = Left(lpStartupPath, InStr(lpStartupPath, Chr(0)) - 1) StartupMenu = lpStartupPath End Function |
Get Startup Folder |
Express News India | Freelance ecommerce web development India