Adding desktop shortcuts and start program entries

  • Thread starter Thread starter Jack Russell
  • Start date Start date
J

Jack Russell

Can anyone tell me if there is a .net way of doing these things.

I have VB6 code but assume there is a new way.

Thanks
 
Jack,

Do you mean, keys (that goes the same)?

Or do you mean deployment?.

Or something else?

Cor
 
Hi you can use this to create a shortcut on the desktop:

Private Sub CreateShort()
Dim m_Shortcut As ShellShortcut
m_Shortcut = New ShellShortcut(Environment.GetFolderPath
_(Environment.SpecialFolder.DesktopDirectory) & "\YourApp.lnk")
With m_Shortcut
.Path = "Path to your app"
.WorkingDirectory = "path to the working directory"
.Description = "Description"
.Save()
End With

End Sub

hth

Greetz Peter
 
Cor said:
Jack,

Do you mean, keys (that goes the same)?

Or do you mean deployment?.

Or something else?

Cor
I am thinking of writing my own "deployment" program in .net since I can
get the setup bootstrap to install dotnetfx and hopefully start my
program . So I want to set up a desktop shortcut to the program that I
will install and add a group and shortcut to the Start, All programs list.

With VB6 I just modified setup1 and I would do the same here if I could
but it seems they do not give us the source of the windows installer and
even if they did I doubt that it would be in VB.

After typing all this I realise I have not quite worked out how to get
the bootstrap to start my program!

Jack
 
Jack Russell said:
Can anyone tell me if there is a .net way of doing these things.

Where/when do you want to do that? Typically a setup program is used to add
start menu entries and desktop shortcuts. VS.NET's setup editor supports
specifying such shortcuts.
 
Peter,

Peter Proost said:
Hi you can use this to create a shortcut on the desktop:

Private Sub CreateShort()
Dim m_Shortcut As ShellShortcut

Where did you find the 'ShellShortcut' class?

BTW: I am just curious why you are using the 'm_' prefix for a local
variable ;-).
 
ooops, I should have posted this link:

http://www.msjogren.net/dotnet/eng/samples/dotnet_shelllink.asp

My bad

Greetz Peter, and as for the m_prefix, there is no logical explanation
except if I'm one of the reasons why the universe is winning (see my footer)

--
Programming today is a race between software engineers striving to build
bigger and better idiot-proof programs, and the Universe trying to produce
bigger and better idiots. So far, the Universe is winning.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top