Jump to content

RunOnceEx registry key for Current User?


Recommended Posts

Okay,

For global post installation I use:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

to install system wide apps and settings. That all works just the way I like it (thanks to the guidence of this website :) )

However I have a few applications the need to run something once when the user first logs in. For example, if you have a multiuser machine with Open Office, each user on the machine does an install from a local administrative setup. The same things goes with Firefox and ffdeploy; you have to run something to copy the profile info into the new user.

Now what I am doing is adding a bunch of registry keys to the default user (I have to load the NTUSER.dat hive first) so that when I make new users they inherit those keys. So far so good. But...

I can do:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce]

"1"="C:\\Program Files\\Mozilla Firefox\\createprofile.vbs"

and it works but I don't get the nice RunOnceEx dialog. Also I find that my desktop loads up before all the stuff I have in RunOnce finishes, so I get this wierd problem where not all my applications are installed until a minute or so after the desktop loads up the first time.

I'd like to do

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnceEx]

"1"="C:\\Program Files\\Mozilla Firefox\\createprofile.vbs"

so that it pauses loading the desktop and gives some visual feedback as to what is happening during the first time you log in. But this doesn't seem to work.

Is there such a thing as RunOnceEx for the current user? I've searched all over this forum and the microsoft knowledge base and google and I don't get a straight answer. I've found examples at MS for this but none of them work. So either XP doesn't support this or I am doing something really wrong.

The main reason why I want to set things up this way is that I like to put all the installation stuff for an application in one place. That makes it easier to maintain. Otherwise I have to run the installers during the time I create users, which to me seems a bit messy.

I know in the end it's all the same, but like a lot of you I tend to be a perfectionist, otherwise why would I spend so many hours creating my unattended install? So if anyone knows a way to solve my problem I would appreciate it. I figure I can't be the only one to try something like this.

Thanks!

John

Link to comment
Share on other sites


Try this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx]
"TITLE"="Configure User profile ..."

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\001]
@="Mozilla"
"1"="command1"
"2"="command2"

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\002]
@="Other stuff"
"1"="command1"

Edited by sonic
Link to comment
Share on other sites

Try this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx]
"TITLE"="Configure User profile ..."

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\001]
@="Mozilla"
"1"="command1"
"2"="command2"

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\002]
@="Other stuff"
"1"="command1"

Hmmm, see I tried that exactly and nothing happens. After I restart and log in I can open the registry and I see all the keys are there, just like above, but nothing happened.

Is this supposed to work? Any other WinXP SP2 users out there have time to give the above a try and let me know what happens?

At this point it's starting to become a mania for me. I know I could just as easily code up something myself but I'm curious. Maybe I messed something up when I was installing my box. I have no idea.

Thanks for the help so far!

Link to comment
Share on other sites

Your concept of wanting a RunOnceEx that does the current user seems off track in my opinion. When RunOnceEx runs, the current user is logged on, and inherits the current user settings and the other goes to the all users.

If you want programs to be shared as a current user for all concept, then you should look at installing from Cmdlines.txt. No one is logged in at that time. Each user will inherit a profile of their own for each program installed at this time. Shortcuts are created for any new profiles, etc. Seems to me, this is what you are asking for instead of using RunOnceEx?

Link to comment
Share on other sites

Your concept of wanting a RunOnceEx that does the current user seems off track in my opinion. When RunOnceEx runs, the current user is logged on, and inherits the current user settings and the other goes to the all users.

If you want programs to be shared as a current user for all concept, then you should look at installing from Cmdlines.txt. No one is logged in at that time. Each user will inherit a profile of their own for each program installed at this time. Shortcuts are created for any new profiles, etc. Seems to me, this is what you are asking for instead of using RunOnceEx?

I actually run all my application installations from a series of batch files that get executed when the Administrator auto logs in the first time. I find that many applications need a 'real' user and can't be installed from cmdlines.txt. I figure a lot of other people must do the same, since the HKLM RunOnceEx method is popular and is described on the homepage.

The problem I have is that after I create the users for the machine, which is the last thing I do under the administrator account. I need to make sure that some stuff runs the first time a user logs in. This has to happen for each of the users I put onto the system. This is running user specific stuff, like deploying a firefox profile and installing open office from a local administrative install point.

I can't user the RunOnceEx under HKLM because this will run the next time anyone logs in. I need something to run each time a user logs in the first time on the machine.

I can do this with the runonce under HKCU, but I find that because it doesn't give such nice visual feedback and because the desktop finishes loading before all the stuff in runonce finishes, it's a bit messy and could cause some confusion to my users. So I would prefer a nice clean and visual feedback to the finalization of a user the first time she logs on. That's why I asked if anyone knows if there was a RunOnceEx for the HKCU registry setting. Someone posted an example of what this could look like but it doesn't work for me.

So the question I am trying to answer is if the above registry example SHOULD work for me. I'm hoping someone out there has time and is curious like me to get the answer. MS knowledge base does speak of a RunOnceEx registry key under HKCU but there are not working examples on the MS site that I can find.

Thanks for all the suggestions so far. This website and all of you in the forums has made my life much easier over the past year as I learn about windows deployment.

--john

Link to comment
Share on other sites

Well,

If anyone else does a search on this problem and finds this forum, it appears that runonceex is only for the HKLM key, not the KHCU key. If I ever find out otherwise, I'll update this thread.

thanks!

Link to comment
Share on other sites

I think your HKCU RunOnceEx concept is certainly not offtrack. There are many reasons for wanting to run an initialization script on a per user basis. Also, I believe you are right about RunOnceEx only working for the Local Machine. My suggestion would be to use the StubPath section of the Active Setup key. Here is a link to a post a made long ago, with a link to an example using Active Setup for Virus propagation ...

http://www.msfn.org/board/index.php?showto...ndpost&p=131942

I'm sure with a little work you can achive your goal using this StubPath thingy ...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...