Scripting Question

Need a script to run once when a particular user logs on?

10/12/2011 2691 views

Need to have a script run once when a certain user logs on not when anyone logs on, so for example

C3PO is the user
I need C:\Support\Utils\Setup-amended.exe to run when only C3PO logs on and only once

Would appreciate any advice on this

0 Comments   [ + ] Show comments


Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

All Answers

I'd hive off this activity to a script which gets called by the log-in script.

Add a check in the script for the username (checking the %USERNAME% environment variable seems easiest), then check for the installed state of the program. How you do that depends on whether or not it records its state in the usual place, i.e. HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall[ProductCode or Product Name]. If not, you could check the existence of the EXE, a configuration file or registry entry.
Answered 10/12/2011 by: anonymous_9363
Red Belt

What are you looking to have the script do? Some folks like to use check files to see if a script has run; I prefer to set registry flags into HKLM\[company] as those are not only harder for the user to get rid of, they take up less space on the hard drive.

Also, is it an existing or new user on the computer? One PC or multiple? If you're looking at doing this for a container or enterprise, than your main login script with a check of the registry would be good, especially for new user profiles.
Answered 10/13/2011 by: Arminius
Second Degree Green Belt

Don't be a Stranger!

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

Sign up! or login

View more:


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