Using the attached code, I am able to create and delete a shortcut to my program in the startup folder.
However, once created and deleted, the shortcut cannot be created again until the program is closed, then opened again. What is my mistake?
If mnuStartWithWindows.Checked = False Then
'Add to Startup Group
mnuStartWithWindows.Checked = True
fCreateShellLink StartupFolder, "My Program", App.Path + "\My Program", "" & vbNullChar, -1, StartupFolder
'Remove from Startup Group
mnuStartWithWindows.Checked = False
If fso.FileExists(StartupFolder + "\My Program.lnk") Then
fso.DeleteFile StartupFolder + "\My Program.lnk"