
Signature
Olof Lagerkvist
ICQ: 724451
Web page: http://here.is/olof
Olof Lagerkvist <no@email.address> wrote on 29 nov 2004 in
microsoft.public.win2000.termserv.clients:
>> I have been looking all over for a simple solution to
>> execute my application when my users log on to my W2K TS.
[quoted text clipped - 29 lines]
> line. When MyProgram.exe terminates, the session is
> automatically logged off.
That sounds like a very complicated way to start your application
from a batch file:
start/wait my_app.exe
logoff
Note that all the above only should be done as a last resort, when
the starting application leaves an active process in the users
session, thereby preventing the session from closing.
Personally, I would try to find out which process is still running
in the session, and why.
--
Vera Noest
MCSE, CCEA, Microsoft MVP - Terminal Server
http://hem.fyristorg.com/vera/IT
--- please respond in newsgroup, NOT by private email ---
Olof Lagerkvist - 29 Nov 2004 22:42 GMT
> Olof Lagerkvist <no@email.address> wrote on 29 nov 2004 in
> microsoft.public.win2000.termserv.clients:
>>What then happens upon logon is that logonwrap starts
>>MyProgram.exe and sends the parameters following on the command
[quoted text clipped - 6 lines]
> start/wait my_app.exe
> logoff
That would leave a visible console window open and users may close it
(maybe by accident) causing the batch file to stop before it reaches
logoff. Also, users may find it annoying to have the console window open
in their sessions. As an alternative like I wrote in an earlier post it
may be possible to write a small VB script instead and have wscript.exe
run it, that would not create a console window. But in this case I
thought it was easier to write a small C program that compiles to a
small (4 KB) exe file.
> Note that all the above only should be done as a last resort, when
> the starting application leaves an active process in the users
> session, thereby preventing the session from closing.
Of course.
> Personally, I would try to find out which process is still running
> in the session, and why.
Yes, of course, but that is not always possible. A good example is
ctfmon.exe that may sometimes be left running on a session with no
visible applications running, and there are others too that may be
automatically executed when users log on or somewhere else in the
session. It is not always possible to close such processes without a
real logoff command in some way to get them closed.

Signature
Olof Lagerkvist
ICQ: 724451
Web page: http://here.is/olof