Click here to Skip to main content
15,992,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have the following question.

I would like by click on a button copy a link of my application to the user startup folder

VB
-------here i needs admin rights ---------------------------

CreateShortcut(Environment.GetFolderPath(Environment.SpecialFolder.Startup) & "\FileName.lnk", My.Application.Info.DirectoryPath & "\FileName.exe")

-------here I will finished the admin rights ----------------

or for delete this link

-------here i needs admin rights ---------------------------

If My.Computer.FileSystem.FileExists(Environment.GetFolderPath(Environment.SpecialFolder.Startup) & "\FileName.lnk") = True Then
My.Computer.FileSystem.DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.Startup) & "\FileName.lnk")

-------here I will finished the admin rights ----------------


For copy the link for my application in the startup folder I needs admin rights.

How can I request the admin rights dialog only for this command.

All other functionality should be run without admin rights.

Thanks for your help.
Posted
Updated 19-May-14 8:20am
v2

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900