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

Need help getting "Startup" items

P: n/a
I'm making a utility similar to MSConfig, I've found it easy enough to
obtain the startup items from the registry for the current user and local
machine... but what about the Startup folder on the Start Menu?

I've found there are 2 system variables that could help me but.. what is the
proper way to get these locations? And be win95/98/me/nt/2k/xp compatable?

ALLUSERPROFILE=C:\Documents And Settings\All Users
USERPROFILE=C:\Documents And Settings\Current User

But I know you can move your profile and what about roaming profiles?

Also what if I want to list all the users on the machines and their startup
items (via their start menu\startup and registry) then I cant use
CurrentUser to access registry.... hrmmm

Can anyone help?

------
If you respond to one of my posts please respond also via e-mail if possible
as I have limited Usenet access, thank you!
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Locke Nash Cole wrote:
I'm making a utility similar to MSConfig, I've found it easy enough to
obtain the startup items from the registry for the current user and
local machine... but what about the Startup folder on the Start Menu?

I've found there are 2 system variables that could help me but.. what
is the proper way to get these locations? And be win95/98/me/nt/2k/xp
compatable?

ALLUSERPROFILE=C:\Documents And Settings\All Users
USERPROFILE=C:\Documents And Settings\Current User

But I know you can move your profile and what about roaming profiles?
What you need is in the registry. Remember that the Startup folder can also
have a different name in different localised versions of Windows (in the
Dutch version it's called Opstarten), so never hard code these things.
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Shell
Folders contains all the info you need (in this case, the Startup key)

You can actually access this in code without directly accessing the
registry. To get the name of the startup folder for instance, use:
Dim startup As String =
Environment.GetFolderPath(Environment.SpecialFolde r.Startup)
Also what if I want to list all the users on the machines and their
startup items (via their start menu\startup and registry) then I cant
use CurrentUser to access registry.... hrmmm


You might be able to enumerate the members of HKEY_USERS, but remember that
on WinNT/2k/xp/2003 you might not have access to the registry of all users,
and access to their actual start menu location is even more likely to be
restricted, so don't assume you can do this at all.

--
Sven Groot
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.