By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,534 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

Create Short Cut

P: n/a
Hi,
I have a small application with a User Settings form
I would like to give the Users the ability to (at any time) set the
Application to load when the PC is started.

Can someone point me in the direction of how to create a Short Cut and place
it in the folder "C:\Documents and Settings\'User Name'\Start Menu\"
or am I better off setting/unsetting a registry entry somewhere? (noting
that most Users will not have Administrator priviledges.

Thanks

Doug
Nov 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Hi,

I think a normal user always has the right to write to this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run\

If you create a new key there with the name of your exe and in the value the
path to your exe, it will auto-start

hth

Greetz Peter

"Doug Bell" <du*@bigpond.com> schreef in bericht
news:OH**************@TK2MSFTNGP14.phx.gbl...
Hi,
I have a small application with a User Settings form
I would like to give the Users the ability to (at any time) set the
Application to load when the PC is started.

Can someone point me in the direction of how to create a Short Cut and place it in the folder "C:\Documents and Settings\'User Name'\Start Menu\"
or am I better off setting/unsetting a registry entry somewhere? (noting
that most Users will not have Administrator priviledges.

Thanks

Doug


Nov 21 '05 #2

P: n/a
Thanks Peter,
I have just been search to find a way to write to Registry.
In VB VBA I used to call a Windows API but I hope that VB .Net does not
require this.
I found:
SaveSettingAppName, Section, Key, Setting)

but this does not allow you to select the correct section
(Software\Microsoft\Windows\CurrentVersion\Run)

It writes to Software\VB and VBA Program Settings\'AppName'\'Section'\'Key'

Doug
"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
Hi,

I think a normal user always has the right to write to this registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run\

If you create a new key there with the name of your exe and in the value the path to your exe, it will auto-start

hth

Greetz Peter

"Doug Bell" <du*@bigpond.com> schreef in bericht
news:OH**************@TK2MSFTNGP14.phx.gbl...
Hi,
I have a small application with a User Settings form
I would like to give the Users the ability to (at any time) set the
Application to load when the PC is started.

Can someone point me in the direction of how to create a Short Cut and

place
it in the folder "C:\Documents and Settings\'User Name'\Start Menu\"
or am I better off setting/unsetting a registry entry somewhere? (noting
that most Users will not have Administrator priviledges.

Thanks

Doug


Nov 21 '05 #3

P: n/a
Hi Doug,

maybe this helps:

Imports Microsoft.Win32

Dim oRegKey As RegistryKey
Dim oBaseKey As RegistryKey

oBaseKey = Registry.CurrentUser
oRegKey =
oBaseKey.OpenSubKey("Software\Microsoft\Windows\Cu rrentVersion\Run", True)

If Not oRegKey Is Nothing Then
'Read the value
Dim val As Object = oRegKey.GetValue("YourValueName")
msgbox(CStr(val))

'Set the value
oRegKey.SetValue("YourValueName", "your path")
End If

hth Peter

"Doug Bell" <du*@bigpond.com> schreef in bericht
news:uk**************@TK2MSFTNGP15.phx.gbl...
Thanks Peter,
I have just been search to find a way to write to Registry.
In VB VBA I used to call a Windows API but I hope that VB .Net does not
require this.
I found:
SaveSettingAppName, Section, Key, Setting)

but this does not allow you to select the correct section
(Software\Microsoft\Windows\CurrentVersion\Run)

It writes to Software\VB and VBA Program Settings\'AppName'\'Section'\'Key'
Doug
"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
Hi,

I think a normal user always has the right to write to this registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run\

If you create a new key there with the name of your exe and in the value

the
path to your exe, it will auto-start

hth

Greetz Peter

"Doug Bell" <du*@bigpond.com> schreef in bericht
news:OH**************@TK2MSFTNGP14.phx.gbl...
Hi,
I have a small application with a User Settings form
I would like to give the Users the ability to (at any time) set the
Application to load when the PC is started.

Can someone point me in the direction of how to create a Short Cut and

place
it in the folder "C:\Documents and Settings\'User Name'\Start Menu\"
or am I better off setting/unsetting a registry entry somewhere? (noting that most Users will not have Administrator priviledges.

Thanks

Doug



Nov 21 '05 #4

P: n/a
Peter thanks,

I was just about to post that I had found that.
I am starting to build a class as a wrapper to Create, Read, Write, and
Delete Keys

So that I can re-use it.

Thanks for your responses.

Doug
"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi Doug,

maybe this helps:

Imports Microsoft.Win32

Dim oRegKey As RegistryKey
Dim oBaseKey As RegistryKey

oBaseKey = Registry.CurrentUser
oRegKey =
oBaseKey.OpenSubKey("Software\Microsoft\Windows\Cu rrentVersion\Run", True)

If Not oRegKey Is Nothing Then
'Read the value
Dim val As Object = oRegKey.GetValue("YourValueName")
msgbox(CStr(val))

'Set the value
oRegKey.SetValue("YourValueName", "your path")
End If

hth Peter

"Doug Bell" <du*@bigpond.com> schreef in bericht
news:uk**************@TK2MSFTNGP15.phx.gbl...
Thanks Peter,
I have just been search to find a way to write to Registry.
In VB VBA I used to call a Windows API but I hope that VB .Net does not
require this.
I found:
SaveSettingAppName, Section, Key, Setting)

but this does not allow you to select the correct section
(Software\Microsoft\Windows\CurrentVersion\Run)

It writes to Software\VB and VBA Program

Settings\'AppName'\'Section'\'Key'

Doug
"Peter Proost" <pp*****@nospam.hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP09.phx.gbl...
Hi,

I think a normal user always has the right to write to this registry key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run\

If you create a new key there with the name of your exe and in the value
the
path to your exe, it will auto-start

hth

Greetz Peter

"Doug Bell" <du*@bigpond.com> schreef in bericht
news:OH**************@TK2MSFTNGP14.phx.gbl...
> Hi,
> I have a small application with a User Settings form
> I would like to give the Users the ability to (at any time) set the
> Application to load when the PC is started.
>
> Can someone point me in the direction of how to create a Short Cut
and place
> it in the folder "C:\Documents and Settings\'User Name'\Start Menu\"
> or am I better off setting/unsetting a registry entry somewhere?

(noting > that most Users will not have Administrator priviledges.
>
> Thanks
>
> Doug
>
>



Nov 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.