How to run a program only once per new user logon

pts.
Tags:
Microsoft Windows
Hello I am trying to find a way to run a script one time in Windows XP and only if the user has never logged onto the comuputer before. I have a script to setup printers and email profile so I would only need to run the script one time per user. Any ideas would be appreciated Thanks

Answer Wiki

Thanks. We'll let you know when a new response is added.

That’s easy. Just put a reference in the RunOnce key in registry for the “Default user”. Then when a user logs in for the first time the profile is copied from default user and runonce is deleted automatically after being run once.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Shellie
    Thanks for the reply, is this the key you suggest using: HKEY_USERS.DEFAULTSoftwareMicrosoftWindowsCurrentVersionRunOnce If so I did try that and it did not run. I created a value called test.bat and just pointed it to c:test.bat.
    0 pointsBadges:
    report
  • KFaganJr
    This is an old question so I hope you figured it out already but I came across it looking for a solution for myself and thought it may help anyone else still looking. I found this knowledge base on Microsoft that should help. It sounds like the keys are deleted before the os get's to a point that will allow a script to run, so you need to prefix it with an ! to make it work correctly. By default, the value of a RunOnce key is deleted before the command line is run. You can prefix a RunOnce value name with an exclamation point (!) to defer deletion of the value until after the command runs. Without the exclamation point prefix, if the RunOnce operation fails the associated program will not be asked to run the next time you start the computer. http://msdn.microsoft.com/en-us/library/aa376977%28VS.85%29.aspx
    1,355 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following