Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
How to get startup folder path?
How can i find the path to startup folder(s)? Preferably a method that will work on windows 98 through to windows XP and using C or Visual Basic.
Currently i have VB code that i was going to convert to C. It can get me the "All Users" startup folder but i'm unsure if i can get it to get me the current users startup folder aswell. The code is shown below: (not mine)
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
Public 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
Can anyone help me in getting the all users startup folder aswell as the current users startup folder on windows 98 through to windows XP?