Link to home
Start Free TrialLog in
Avatar of Ra
Ra

asked on

Startup shortcut

I need to add a link to my program in the StartUp folder for the current user.  I want to have this shortcut use a command line parameter of "/m".  I aslo want to delete this shortcut whenever I need to.  I want to do this only in my program and not in the setup program.  This also needs to work for Windows 95, 98, and NT 4.0 so I need to check for secruity permissions if it is NT.  I'll appreciate any help.  Thanks.
Avatar of viktornet
viktornet
Flag of United States of America image

check out the VB fCreateShellLink() function.... that'll do what you want...

..-=ViKtOr=-..
Avatar of Ra
Ra

ASKER

and where do I find this function to check it out???  It is definitly not in help.  I type it in and the VB compiler says sub or function not defined.  I need more info.
Declare Function OSfCreateShellLink Lib "vb6stkit.dll" Alias "fCreateShellLink" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrLinkArguments As String, ByVal fPrivate As Long, ByVal sParent As String) As Long

Check the setup1 program that comes with VB
ASKER CERTIFIED SOLUTION
Avatar of viktornet
viktornet
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
in any languaje?
Please grade!
Avatar of Ra

ASKER

Thanks viktornet, it works great.  I already found out how to find if it already exist and to delete it if necessary.

Sorry it took so long for me to respond, I've been very busy with projects at work.

Thanks a bunch.
Avatar of Ra

ASKER

Oh, one more thing.  I assume I can add something to the lpstrLinkArguments to make it start up minimized.  What do I need to do that?

Thanks again.