VB6 Create/Delete Shortcuts including Special Folders like Startup
I couldn't find any working code showing how to create and delete Startup menu shortcuts.
I feel it's the best way to have your program start when Windows boots because it's easy for even a nubee user to get rid of it.
This code requires VB6 and the vb6stkit.dll.
I've tested it and it works on WinXP.
You don't need the Windows Scripting Host or the System File Object.
And it doesn't mess with the registry.
Why add the dependencies or risk being flagged a Virus risk?
The download contains the Shortcuts and Special Folders module and it has a form for testing some of the module procedures.
The GetSpecialFolderPath function uses an Enum to make it easy to use.
I believe this will work on Win98 and up.
But I need some people to test it and let me know for sure.
Thx and enjoy!
----------------------------------
Just made fixes to the HasStartupShortcut function.
Wrote it without testing it
Posting version 1.01 now
P.S.
I forgot to mention that this module should be able to make shortcuts anywhere and has subs specifically for making them on the Desktop, in Programs Menu, and in Startup Menu.
Last edited by longwolf; Oct 6th, 2008 at 09:39 PM.
Reason: fixing the title
Last edited by westconn1; Oct 17th, 2008 at 06:18 PM.
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Re: VB6 Create/Delete Shortcuts including Special Folders like Startup
i seldom use FSO unless for vb script, but some scripting and WMI makes a lot of tasks much simpler
as i said, this is just an alternative
as you say with getspecialfolders, it is essential to use some method to find user and system folders
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case. Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete