Need a script to run once when a particular user logs on?
Hi
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
Thanks
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
Thanks
0 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
anonymous_9363
13 years ago
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.
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.
Posted by:
Arminius
13 years ago
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.
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.