Click here to Skip to main content
15,902,112 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to update a VB .NET application? Pin
Steven J Jowett19-Jan-10 1:14
Steven J Jowett19-Jan-10 1:14 
GeneralRe: how to update a VB .NET application? Pin
jeshra27921-Jan-10 0:30
jeshra27921-Jan-10 0:30 
QuestionI Need Help On Vb.net Smart Devices [modified] Pin
bernard tang18-Jan-10 21:27
bernard tang18-Jan-10 21:27 
AnswerRe: I Need Help On Vb.net Smart Devices Pin
jerryj19-Jan-10 3:31
jerryj19-Jan-10 3:31 
GeneralRe: I Need Help On Vb.net Smart Devices Pin
bernard tang19-Jan-10 16:54
bernard tang19-Jan-10 16:54 
AnswerRe: I Need Help On Vb.net Smart Devices Pin
Rick Shaub19-Jan-10 5:23
Rick Shaub19-Jan-10 5:23 
GeneralRe: I Need Help On Vb.net Smart Devices Pin
bernard tang19-Jan-10 16:59
bernard tang19-Jan-10 16:59 
QuestionQuery regarding the code in MatixCoder's "Autorun Applications" CodeProject article? Pin
Paul Hasler18-Jan-10 20:20
Paul Hasler18-Jan-10 20:20 
In the application I'm developing, I'd like to give the user the option to automatically start the application when windows starts. From my searches it looks like setting a registry key is one of the best ways to do it.

I haven't ever played with the Registry in my programs before (I've only ever manually edited the registry), so I want to make sure I get it right.

I came across MatrixCoder's article "Autorun Applications" which is quite clear and straight forward.

He uses the following sub and passes it System.Reflection.Assembly.GetEntryAssembly.Location for path in order to set the registry key.
Private Sub AddCurrentKey(ByVal name As String, ByVal path As String)
   Dim key As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
   key.SetValue(name, path)
End Sub


If the key already exists, will this just overwrite it, or will it add another key each time AddCurrentKey() is called?

If it would keep on adding further keys, how would the code best be modified to check if the key already exists?

Regards

Paul Hasler

modified on Tuesday, January 19, 2010 5:03 AM

AnswerRe: Query regarding the code in MatixCoder's "Autorun Applications" CodeProject article? Pin
loyal ginger19-Jan-10 4:50
loyal ginger19-Jan-10 4:50 
AnswerRe: Query regarding the code in MatixCoder's "Autorun Applications" CodeProject article? Pin
Dave Kreskowiak19-Jan-10 6:35
mveDave Kreskowiak19-Jan-10 6:35 
GeneralRe: Query regarding the code in MatixCoder's "Autorun Applications" CodeProject article? Pin
Paul Hasler20-Jan-10 4:53
Paul Hasler20-Jan-10 4:53 
QuestionInvalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Pin
vidhish18-Jan-10 20:12
vidhish18-Jan-10 20:12 
AnswerRe: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Pin
Thomas Krojer18-Jan-10 23:30
Thomas Krojer18-Jan-10 23:30 
GeneralRe: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Pin
vidhish19-Jan-10 0:04
vidhish19-Jan-10 0:04 
GeneralRe: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Pin
DJ Matthews19-Jan-10 2:48
DJ Matthews19-Jan-10 2:48 
GeneralRe: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Pin
Thomas Krojer19-Jan-10 3:34
Thomas Krojer19-Jan-10 3:34 
GeneralRe: Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) Pin
vidhish20-Jan-10 2:17
vidhish20-Jan-10 2:17 
QuestionUSB Control Pin
jmcgill18-Jan-10 11:12
jmcgill18-Jan-10 11:12 
AnswerRe: USB Control Pin
DaveAuld18-Jan-10 12:37
professionalDaveAuld18-Jan-10 12:37 
GeneralRe: USB Control Pin
jmcgill18-Jan-10 13:20
jmcgill18-Jan-10 13:20 
GeneralRe: USB Control Pin
Dave Kreskowiak18-Jan-10 18:33
mveDave Kreskowiak18-Jan-10 18:33 
GeneralRe: USB Control Pin
DaveAuld19-Jan-10 2:32
professionalDaveAuld19-Jan-10 2:32 
Questionhow do I know which button was clicked Pin
spawneditions18-Jan-10 8:43
spawneditions18-Jan-10 8:43 
AnswerRe: how do I know which button was clicked Pin
Luc Pattyn18-Jan-10 10:11
sitebuilderLuc Pattyn18-Jan-10 10:11 
GeneralRe: how do I know which button was clicked Pin
spawneditions18-Jan-10 10:30
spawneditions18-Jan-10 10:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.