Adding/Removing Items to/from Start Menu

How can I add/remove items to/from the StartUp section of the Start Menu. NOTE: This would have to work for both Windows 95 and Windows NT ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


here is a code snippet I got from someone a while ago...


  ShlObj, ActiveX, ComObj, Registry;

procedure TForm1.Button1Click(Sender: TObject);


  MyObject  : IUnknown;

  MySLink   : IShellLink;

  MyPFile   : IPersistFile;

  FileName  : String;

  Directory : String;

  WFileName : WideString;

  MyReg     : TRegIniFile;


  MyObject := CreateComObject(CLSID_ShellLink);

  MySLink := MyObject as IShellLink;

  MyPFile := MyObject as IPersistFile;

  FileName := 'NOTEPAD.EXE';

  with MySLink do begin





  MyReg := TRegIniFile.Create(


// Use the next line of code to put the shortcut on your desktop

  Directory := MyReg.ReadString('Shell Folders','Desktop','');

// Use the next three lines to put the shortcut on your start menu

//  Directory := MyReg.ReadString('Shell Folders','Start Menu','')+

//      '\Whoa!';

//  CreateDir(Directory);

  WFileName := Directory+'\FooBar.lnk';





hope this helps


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
j_mollaghanAuthor Commented:
I figured it out myself. I used a slightly different approach (using SHGetSpecialFolderLocation to find the location of the StartUp folder within the Start Menu).
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.