Thread: Startup using STARTUP folder method for winXP & win98

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    Thumbs up Startup using STARTUP folder method for winXP & win98

    hi, i m creating a proggy that starts up using startup folder method, not using the registry method in this case
    i understand that the startup folder for winxp and win98 are different
    how do i make a proggy that works for these 2 platforms?

    using the API

    CopyFile("current_dir","%ALLUSERSPROFILE%\\Start Menu\\Programs\\Startup",FALSE);

    doesnt give me the result i want in win98 and winXP
    the file doesnt copy
    is there an API that retrives the path to the startup folder?

    your assistance please :wave:

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Code:
    // Include shlobj.h and link with shell32.lib
    #include <shlobj.h>
    #pragma comment(lib, "shell32.lib")
    
    TCHAR szPath[MAX_PATH];
    SHGetSpecialFolderPath(NULL, szPath, CSIDL_STARTUP, TRUE);

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    114
    that's great help, thx!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. my method to optimize application startup performance
    By George2 in forum C Programming
    Replies: 17
    Last Post: 11-22-2007, 11:26 PM
  2. Replies: 1
    Last Post: 07-12-2005, 10:03 PM
Website Security Test