Solved

Registry

Posted on 2006-07-16
12
351 Views
Last Modified: 2010-04-30
Are the startup locations in the registry the same for all the major versions of windows (95 - XP)
These 2:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Also can someone explain the difference between the 2.
I know the HKEY_LOCAL_MACHINE...\run will start no matter who logs in

but the HKEY_CURRENT_USER...\run will run when whatever user logs in that was logged in when the entry was made??  Not sure how this one works...

Thanks and Cheers!
Albert
0
Comment
Question by:ahammar
12 Comments
 
LVL 65

Accepted Solution

by:
rockiroads earned 350 total points
Comment Utility
Yes, thats what Ive found with Win2K and XP at least

There is also the shortcuts in the Startup groups

Difference between the two is

LOCAL_MACHINE - startups represent ALL users
CURRENT_USER - represents the user logged on

Each user has their own registry settings

Earler versions (I think this includes Win95) had startup settings in Win.INI (or one of those config files also)

0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
There is a utilty called MSCONFIG that also allows u to check the startups

Remember the other registry keys also

there is RunOnce - I guess apps that get run once only :)
RunServices/RunServicesOnce

0
 
LVL 9

Assisted Solution

by:pradapkumar
pradapkumar earned 75 total points
Comment Utility
excuse me,
As i understand that
LOCAL_MACHINE - this startup triggered whenever the machine restarts/rebooted
CURRENT_USER - this startup triggered whenever the users logged in(irrespective of username)

Pradap
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
The key HKEY_USERS represents the settings for all users. Each user identified by some unique number.
Now I guess HKEY_CURRENT_USER acts as a view to your registry settings, so each user see's this but it points to their own settings (whether its loaded or pointed Im not sure)
It helps with installing/running apps, security etc
0
 
LVL 23

Author Comment

by:ahammar
Comment Utility
Ok, so if I make an entry to start an application in the CURRENT_USER location while someone is logged in, then that application will only start when that particular user logs in and not when someone else logs in, right?? Also, when someone logs off and someone else logs in, the applications that were started in the same manner (from CURRENT_USER) will end??  Is that also right?

Thanks for such a quick reply!
albert
 
0
 
LVL 23

Author Comment

by:ahammar
Comment Utility
my goal here is to be able to make registry entries to start applications no matter who logs in, and registry entries to start apps only when the user that installed it logs in.  I need to be able to do it both ways.

Thanks!
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
What u then want is HKEY_LOCAL_MACHINE, this affects all users
Depending on what u want to run when user logs in, u add in either HKEY_LOCAL (all) or HKEY_CURRENT (person logged in only)

The alternative, like I said earlier, is to add to the Startup Folder for All Users/Logged in user


0
 
LVL 23

Author Comment

by:ahammar
Comment Utility
thanks!
Yeah, I do use the startup folder locations too, but in some cases I don't want the shortcuts to be so easily accessible.  Some of my apps are for preventing certain people from doing certain things (mainly peoples children) and I don't want them to be able to simply delete the shortcuts (for the ones that are experienced enough to do that) to prevent them from running.
I still have the problem of keeping them from uninstalling though.  Haven't figured out a solution for that one yet...:-(

Thanks for everything!  I'll probably accept answer(s) tomorrow.

Cheers!
Albert
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
Well u have to have something that uninstalls your s/w. Usual location is in LOCAL_MACHINE/Software/Microsoft/Windows\CurrentVersion/Uninstall
but if u do not want them to uninstall, dont create any links to it

Another thing u could possibly do is, the program that starts running it, if u pass in a parameter there to uninstall e.g.

myprog.exe -uninstall

that could uninstall it, this way u do not have a seperate program needed to uninstall

There is nothing stopping users from deleting your installed directory though, so how much benefit u get from hiding uninstall, Im not sure
0
 
LVL 1

Assisted Solution

by:RegProctor
RegProctor earned 75 total points
Comment Utility
As stated earlier, in XP you can use MSConfig from the Run command line to see all the startup locations.

From memory, RunOnce is primarily for Installation programs that need to keep running themselves after a reboot.

Use the Local_Machine...run startup registry entry if you want your program to run for all users. Also, at least in XP, only users with Admin privelages can change those certain registry entries under Local_Machine so that's one way you can secure the startup of your app. As you go back through the versions of OS's it gets harder as MS wasn't noted for it's security abilities in times past.

Your best bet for earlier versions of Windows would probably be to run a service, even if all that service did was launch an app. since most users won't know how to get to a service. Those that do won't likely know yours from all the others as the list of services is quite extensive and you can give it some OS sounding description "Remote Services Helper" for example... I wouldn't touch such a thing without fully researching it. You can also leave the service running so that it can detect that an app. has been shut down and then take appropriate action such as quietly notify you or just restart the app.

Reg
0
 
LVL 23

Author Comment

by:ahammar
Comment Utility
Thanks everyone!
Sorry it took me so long to get back to this.  I've learned a lot here and done some experimenting based on these comments.
I better get this question closed.  I think I have it figured out now.  I will split the points, but rockiroads will have to get the majority as he was first and offerred the mose information.
Thanks to every one of you!

Cheers!
Albert
0
 
LVL 65

Expert Comment

by:rockiroads
Comment Utility
Cheers
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now