Re: Logging off session after closing application

From: eddie (eddie_at_discussions.microsoft.com)
Date: 02/14/05


Date: Mon, 14 Feb 2005 12:45:04 -0800

The test works fine, but if I run the batch file from within the ts session
the same happens as before - when the application is starting it tries to
logoff the session before it comes up...

I think I'll try to find another solution, but if You will take a look at
the batch file a last time to see if there is something wrong with the syntax
it would be fine.

start /wait \\server\folder\foxproapp.exe
logoff

Thanks

"Vera Noest [MVP]" wrote:

> That's weird! start /wait is a standard command.
> Could you try it in a command window?
> Open a command windows (Run cmd) and type
> "start /wait echo Waiting" (without the quotes)
> You should see a second window which executes the "echo" command
> and displays the output: "Waiting", followed by your current
> directory and the cursor. This represents your 16-bit application.
> The first window is waiting for the second application to end and
> is therefore *not* returning to the cursor.
> Now quit the application (type "exit" in the second command window)
> and you will see that the first window continues execution and
> returns you to the command prompt.
>
> If this works (and it better should, or you have something really
> strange going on), can you try this: log on to the TS desktop
> without defining a starting application, and run the batfile
> interactively? Does it run the application then, or does it execute
> the logoff command without waiting for the application to finish?
>
> --
> Vera Noest
> MCSE, CCEA, Microsoft MVP - Terminal Server
> http://hem.fyristorg.com/vera/IT
> --- please respond in newsgroup, NOT by private email ---
>
> "=?Utf-8?B?ZWRkaWU=?=" <eddie@discussions.microsoft.com> wrote on
> 13 feb 2005 in microsoft.public.windows.terminal_services:
>
> > Thanks for the answer..
> >
> > I ment shutdown /l by the way.
> >
> > It is a 16-bit application.
> > I have created a batch file and used start /wait and the
> > application starts when I logon but tries to log me off
> > immediately . It seems that the wait command does not work
> >
> > eddie
> >
> >
> > "Vera Noest [MVP]" wrote:
> >
> >> "shutdown /r" as the last line???
> >> Do you want your users to reboot the server everytime they quit
> >> an application?
> >>
> >> If the application is a 32-bit application, you should not need
> >> to do anything, because quitting the application automatically
> >> ends the TS session.
> >> If it is a 16-bit application, you could have a problem with
> >> the ntvdm not closing, and thereby preventing the session from
> >> ending. If that's the case, try this:
> >>
> >> create a batfile, lets say "start_my_16_bit_app.bat", which
> >> contains:
> >>
> >> start /wait my_16_bit_app.exe
> >> logoff
> >>
> >> Define this batfile as the starting application in the users TS
> >> session.
> >>
> >> --
> >> Vera Noest
> >> MCSE, CCEA, Microsoft MVP - Terminal Server
> >> http://hem.fyristorg.com/vera/IT
> >> --- please respond in newsgroup, NOT by private email ---
> >>
> >> "=?Utf-8?B?ZWRkaWU=?=" <eddie@discussions.microsoft.com> wrote
> >> on 13 feb 2005 in microsoft.public.windows.terminal_services:
> >>
> >> > Case:
> >> > Windows 2003 terminalserver.
> >> > I have som users with this demand (they are in a separate
> >> > GPO)
> >> >
> >> > 1. When they start a ts session an application shall start
> >> > (This part is OK - I use GPO or Active Dir Users and Comp)
> >> >
> >> > 2. When they are finished with the application and quit the
> >> > application the normal way, I want the terminalsession to be
> >> > logged off automatically.
> >> >
> >> > i have tried to make a startup script with shutdown /r as the
> >> > last line but I 'm not sure how I can get the script to wait
> >> > until the application finish, and then execute logoff /r.
> >> >
> >> > Eddie
>



Relevant Pages

  • Re: application shut down does not force logout
    ... nope...it just opens up a command prompt window,executable does not start.... ... > this: create a small batch file containing the following: ... >> I'll bet mnybbsvc.exe is preventing the session from ...
    (microsoft.public.windows.terminal_services)
  • Re: DOS Terminal Session Does Not Close
    ... application) just fires up the second batch file with the /min flag ... >> session should be automatically logged off when you quit the ... >> MCSE, CCEA, Microsoft MVP - Terminal Server ...
    (microsoft.public.win2000.termserv.apps)
  • Re: Cant schedule a batch file to run in the XP Pro Scheduler
    ... command window or a shortcut on the desktop. ... > If the bat file does not work from cmd, how will it work by scheduling it? ... Examples of Backup Batch ... The Partner who installed it wrote a batch file, which works fine, ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Preserve Clipper error messages on screen
    ... batch file which launches the application. ... the XP command window closes and the user is returned ... If the program bombs, I am able ...
    (comp.lang.clipper)
  • Re: Oh for an autoexec.bat!
    ... but what I was after was a way of running said batch file ... command window, which I usually do by clicking on the icon. ... >> give me some additional DOS commands using DOSKEY. ... >> to do this every time I open a cmd window. ...
    (microsoft.public.windowsxp.general)