/build/static/layout/Breadcrumb_cap_w.png

Using RunOnce Key

As per my app requirement, I need that application should auto launch for every log-in and log-off (i.e. for every user it should launch automatically.)

I will be using RunOnce for this.I have never used this key.I know we have to create entry for this in : HKCU\Software\Microsoft\Windows\CurrentVersion\...do I need to make same entry in HKLM as well, does it work the way Active Setup works.Comparing HKLm and HKCU or is it like entry in HKCU would be fine.

Also how do I give the exe name in value.


0 Comments   [ + ] Show comments

Answers (6)

Posted by: mduiker 10 years ago
Orange Senior Belt
1

You could try to use local logon and logoff scripts with 'if member of' parts.

Posted by: piyushnasa 10 years ago
Red Belt
0

Hey Deepali,

 

What is the issue in using Active Setup if you require the same functionality.

Runonce will only run for Admin users and not for normal users.. Well that is what I have learnt.. Not sure if it still holds true.

 

Cheers,

Piyush


Comments:
  • Hi Piyush...never used RunOnce...so just wanted to make sure before I do so...as it is a real trouble testing a package in our environment....If it runs only for Admin users....then its of no use....You are right...I can use Active Setup in this case...will give it a try..Thanks :)) - deepali 10 years ago
  • anytime :) - piyushnasa 10 years ago
Posted by: anonymous_9363 10 years ago
Red Belt
0

>add it to the default users hive.
...remembering that that is only valid for new users local to the machine, not domain users.

>Th requirement is that it should run only on first launch of every user.If he logs in for the second time, this should not auto launch the app
Sooooooooooooooooooooooo...Active Setup, then!


Comments:
Posted by: rileyz 10 years ago
Red Belt
0

Use this instead, it will start for all users who log on, and save you from populating something into HKCU.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
You dont need to make this entry in HKCU, only in HKLM.

 

You only use ActiveSetup when you dont have a entrypoint and you need to inject something into HKCU. And to answer your last question, its not like ActiveSetup, Windows will just reads that key location and starts the app required in the registry key value.


Comments:
  • Thanks for ur reply.....I think Run key would work everytime a user logs-in.Th requirement is that it should run only on first launch of every user.If he logs in for the second time, this should not auto launch the app. - deepali 10 years ago
  • Ah ok, dont use my suggestion then, will just annoy your users a lot.
    Humm, Im not sure if RunOnce will do what you want it to do as it will be removed once it has run.

    What is your requirement, why do you need it to run for each user? If you let us know we can give you better answers - I have a feeling you may need ActiveSetup (yuck) but you could get away with a EntryPoint. - rileyz 10 years ago
  • Yes...I think Active setup would work :) - deepali 10 years ago
Posted by: olditguy 10 years ago
Second Degree Blue Belt
0

RunOnce will only run the program for the first user who logs in after the install and it should be a HKLM key. This is usually used to configure an app after install. Once it has run the key is deleted. Make sure the permissions on the key are set correctly otherwise the key won't be deleted by a non-admin logon. If you want it to run every time a user logs on then use Run instead of RunOnce and, again, it needs to be an HKLM key. If you use HKCU it only runs for that specific user.

To set it up you use a name (any name is OK) set the type to be REG_SZ or REG_EXPAND_SZ if you have envionment variables in the path, and the value is the program name. e.g.

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]

"My Program" = "C:\\My Folder\\My Program.exe"

 


Comments:
  • How to create runonce key& i heard that use *! at the value name why? - @Imran9 6 years ago
Posted by: SMal.tmcc 10 years ago
Red Belt
0

If you are talking when it create the profile for a new user add it to the default users hive.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ