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   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


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: VBScab
Red Belt

Please log in to comment
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

Please log in to comment