Announcement

Collapse
No announcement yet.

TSR snafu

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • TSR snafu

    I copied a example TSR from the PB users guide. It pops up when you press a key. Works great.
    When it ends and returns back to a dos prompt, I run into a unusual problem.

    I have a simple batch file that I type at the Dos prompt that returns you back to the desktop (7.bat). It has one command in it; EXIT
    The problem is, before the TSR is loaded the batch file works great (closes the Dos window and returns you to the desktop)

    After the TSR is loaded and unloaded, I run the batch file from the Dos prompt and it just returns you back to the DOS prompt.
    You have to manually type EXIT at the Dos prompt, to return back to desktop.

    Its a minor problem, but my users are familiar using 7.bat to get back to desktop, and if I could, I would like to not change that.

    Any ideas
    Thx


    ------------------


    [This message has been edited by Walter VanDerwall (edited April 29, 2005).]

  • #2
    Walter,

    I cannot directly answer your question. I have used the MASM 6.14
    compiler to create a program called "E.EXE". I do not remember its exact
    size, but I know it is less than 3kb. When I am at the DOS Prompt
    on my WinXP Pro, I just type "e" and press ENTER. My program then
    stuffs the keyboard with the letters "exit" followed by the $CR key.
    In short, it simulates the user typing it himself. The program worked fine on my
    old Win98SE machine, and it works fine on my new XP machine. So, it you
    want to try the program out, post an e-mail adx for me to send it to, or drop
    me an e-mail at the adx in my signature. The DRAWBACK to my EXE: it actually
    has TWO functions: (1) calling the program without any commandline arguments
    causes it to work as I noted above (2) if a commandline argument is passed
    when calling the program, it assumes it is a file name, and SHELL's to the
    MS-DOS Editor ("edit.com"), specifying the commandline as the filename for
    the editor uses. IF you would like a version of E.EXE that ONLY
    simulates typing "exit", I could recode the program in about 15 seconds.
    Doing so might also make it significantly smaller than 3KB.


    ------------------
    clay at clayclear dot net

    Comment


    • #3
      Not sure if this helps but try using a batch file like this for your 7.BAT ...

      @CLS
      EXIT

      ------------------
      George W. Bleck
      Lead Computer Systems Engineer
      KeySpan Corporation
      My Email

      [This message has been edited by George Bleck (edited April 29, 2005).]
      <b>George W. Bleck</b>
      <img src='http://www.blecktech.com/myemail.gif'>

      Comment


      • #4
        Thx for the responses...

        I knew I could just write an .exe to solve the issue,
        but I did'nt see a reason for the batch file to stop working.
        It's not like its a complicated batch file and the TSR loads up, works great, and unloads itself without
        a problem.

        I tried;
        @CLS
        EXIT

        All that did was clear the screen, put the word EXIT on the first line,
        then ended at the Dos prompt.

        Whats changing about the computer when you run a TSR?
        Something is not getting returned to the state it was before I ran the TSR.

        Further testing has revealed that is works fine on a Win98 machine,
        but fails on my XP Pro & Home machine.

        Any further ideas would be great =)
        Thx

        ------------------


        [This message has been edited by Walter VanDerwall (edited April 29, 2005).]

        Comment


        • #5
          Maybe you need to explicitly "unload" your tsr program...

          that is, your batch file must look like

          Code:
          mytsr.exe       << load tsr
          Do something    << or don't, just use command lines
          mytsr.exe /U    << command to tsr to unload itself
          EXIT
          ???

          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            It looks like its a compatibility problem with POPUP SLEEP and XP.

            I took the batch file out of the equation and heres what I found.

            Try this simple test...
            Open a Command Prompt window in XP.
            The top bar of the window will read Command Prompt
            Any program that you run at this point will have its name reflected in the top bar of that window.

            For example:
            I open a Command Prompt window. The top bar of that window reads Command Prompt
            I then load up a program called Test.exe (name/function doesnt matter, but NOT a TSR). The top bar of the window will now read Command Prompt - test
            When you exit from Test.exe, the top bar of the window will reflect that Test.exe has closed and now just read Command Prompt

            So far no problems...

            Now, replace Test.exe with a TSR created in PB using POPUP SLEEP. (lets call it TSR.exe)
            Everything functions the same except, when you exit TSR.exe, the top bar of the window does'nt
            reflect that it has ended. The Command Prompt window thinks the TSR.exe is still loaded. It will read Command Prompt - tsr
            even though TSR.exe is not running anymore.


            The description of the EXIT command (in a batch file) says:
            "The exit command is used to withdrawal from the currently running application and/or the MS-DOS session."
            Since the computer still thinks that TSR.exe is still running, it thinks it's exiting from Tsr.exe and then drops you at the Dos Prompt.


            Any comment from Tech Support on POPUP SLEEP & XP would be great.

            Thx

            ------------------


            [This message has been edited by Walter VanDerwall (edited April 30, 2005).]

            Comment


            • #7
              Everything functions the same except, when you exit TSR.exe, the top bar of the window does'nt reflect that it has ended. The Command Prompt window thinks the TSR.exe is still loaded. It will read Command Prompt - tsr even though TSR.exe is not running anymore.
              How do you end TSR.EXE?

              Does it get exactly one (1) POPUP and then it dies?

              When I did DOS stuff I did a bunch of TSRs, but I never wrote one that didn't sit in memory until it was explictly unloaded.

              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                The TSR I copied was one of the examples in the PB3.5 users guide. It was quite small, maybe 15 lines.
                Once loaded, you could activate it with a (Ctrl & Alt). A screen would be displayed with an ASCI table.
                When the ENTER was pressed, it would return you back to your original screen, keeping it still loaded.
                If you wanted to unload it, instead of pressing ENTER, ESC would send it to the last line of code (which was END).

                At that point, (Ctrl & Alt) would not activate it, because it was unloaded.
                But the top of the Command Prompt window still reads
                Command Prompt - tsr

                The top of a Win98 Command Prompt window will reflect that it has unloaded, and just read
                Command Prompt

                XP still thinks its loaded, (when its not)...
                Win98 works correctly and reflects its unloaded, (because it is)...


                ------------------




                [This message has been edited by Walter VanDerwall (edited April 30, 2005).]

                Comment


                • #9
                  If you mean the example on pages 221-222 (ASCII chart which appears on Ctrl+Alt), that program does not uninstall itself on <Escape>. It simply goes back to sleep. (And should pop up again on the next Ctrl+Alt)

                  If it's only 15 lines and came from an example, why not post exactly what you have?

                  Although.. I havea feeling this might be one of those "Windows/XP DOS is not MS-DOS" things...

                  MCM


                  Michael Mattias
                  Tal Systems Inc. (retired)
                  Racine WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    Heres the code...
                    The concept comes frome the example, just stripped down to the basics...

                    100 POPUP KEY CHR$(12,0,240)
                    110 DUMMY&=SETMEM(-600000!)
                    120 DO
                    130 POPUP SLEEP USING EMS, "c:\pbswap.$$$"
                    140 CURSORX=POS
                    150 CURSORY=CSRLIN
                    160 DEF SEG=&HB800
                    170 SAVESCREEN$=PEEK$(0,4000)
                    180 CLS
                    190 LOCATE 10,30:COLOR 11:PRINT"Your info here"
                    200 LOCATE 24,15:COLOR 10:PRINT"Press Enter to Continue, ESC to turn off popup";
                    210 IGNORE$=INPUT$(1)
                    220 LOCATE CURSORY, CURSORX
                    230 DEF SEG=&HB800
                    240 POKE$ 0,SAVESCREEN$
                    250 LOOP UNTIL IGNORE$=CHR$(27)
                    260 END

                    ------------------




                    [This message has been edited by Walter VanDerwall (edited April 30, 2005).]

                    Comment

                    Working...
                    X