autoexec.bat for user


Son of Beastie

Reaction score: 106
Messages: 2,530

How do I run a specific program for a given user when he has logged on?


Aspiring Daemon

Reaction score: 240
Messages: 668

I do not know by heart if there is one specific in the users home directory which is called independently of the login shell. I am quite sure you fill find ~/.profile or ~/.login or others which call fortune(6) by default. You can do similar things to achieve your specific goals.



Reaction score: 932
Messages: 1,492

Depends on the shell. You need to read the man pages of the shell you use; in bash it is .profile and/or .bashrc and/or .bash_login, and it tcsh it is .cshrc and/or .tcshrc and/or .login. Note that these files are not all equivalent, and are executed in different situations. Look at the documentation.

When playing with these files: make sure you have another login that allows you to regain access to the machine if you screw up; if you have a terrible error in these files, it might become impossible to log in. Also make sure that the commands that are used for non-interactive shells are very fast and don't create unnecessary output.



Reaction score: 447
Messages: 1,088

There are too many variables: "invisible" program or a GUI app, executed once or at every terminal the user log in, whether the program keeps running in the background or performs a short action, etc. You should consider all possible consequences.



Reaction score: 283
Messages: 1,071

How do I run a specific program for a given user when he has logged on?
The question is good, but does doing that really serve much purpose? Seems to me you can just put an icon on the desktop and the user can click that. This looks especially good if there are no other icons on the desktop.