470,631 Members | 1,501 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,631 developers. It's quick & easy.

Adding desktop shortcuts and start program entries

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
Nov 21 '05 #1
7 3222
Jack,

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

Or do you mean deployment?.

Or something else?

Cor
Nov 21 '05 #2
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

--
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.

"Cor Ligthert" <no************@planet.nl> schreef in bericht
news:#Q**************@TK2MSFTNGP12.phx.gbl...
Jack,

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

Or do you mean deployment?.

Or something else?

Cor

Nov 21 '05 #3
Cor Ligthert wrote:
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
Nov 21 '05 #4
"Jack Russell" <ja***@norubbish.tpg.com.au> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
Peter,

"Peter Proost" <pp*****@nospam.hotmail.com> schrieb:
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 ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6
ooops, I should have posted this link:

http://www.msjogren.net/dotnet/eng/s..._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.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:Oa*************@TK2MSFTNGP15.phx.gbl...
Peter,

"Peter Proost" <pp*****@nospam.hotmail.com> schrieb:
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 ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #7
forgot to add a big :-)

--
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.

"Peter Proost" <pp*****@nospam.hotmail.com> schreef in bericht
news:#5**************@TK2MSFTNGP09.phx.gbl...
ooops, I should have posted this link:

http://www.msjogren.net/dotnet/eng/s..._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.
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schreef in bericht
news:Oa*************@TK2MSFTNGP15.phx.gbl...
Peter,

"Peter Proost" <pp*****@nospam.hotmail.com> schrieb:
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 ;-).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Eskimo Joe | last post: by
1 post views Thread by Roy G. Vervoort | last post: by
reply views Thread by Mike Cooper | last post: by
2 posts views Thread by Darko Topolsek | last post: by
13 posts views Thread by Lloyd Dupont | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.