Announcement

Collapse
No announcement yet.

Run a batch file @ shutdown

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

  • Run a batch file @ shutdown

    Hello,

    I am just looking for the easiest way to run a small batch file that copies a file to a server at shutdown on a Win98 machine. Thank you.

  • #2
    Re: Run a batch file @ shutdown

    I don't believe there's a built-in way to force something to occur before shut down in Windows 9x. You can however do it using 3rd party apps.

    Check out X-ecutor.

    http://www.xpertdesign.de/english/sw_xecutor_info.php4
    Andrew

    ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

    Comment


    • #3
      Re: Run a batch file @ shutdown

      Thanks Andrew, talk about user friendly software! Last question, what do I need at the end of my batch file to force it to close the window? I have @ echo off, and it works perfect, only problem is the command window does not close after the file copy.

      Comment


      • #4
        Re: Run a batch file @ shutdown

        It was my pleasure to help out. I'm glad the app is simple enough to figure out and fills your need.

        To make the dos windows close type "exit" at the end of the batch file.
        Last edited by ahinson; 18th January 2006, 15:28.
        Andrew

        ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

        Comment


        • #5
          Re: Run a batch file @ shutdown

          Yes I did add Exit at the end, but for some reason it didnt seem to work. it still leaves the command window open. and the shutdown hangs at that point. Could it be because I have the batch file echo a reply if it in fact copies the file that it is supposed to? I have would like to have it notify the user if it fails to copy the file for some reason so they will let me know. This is what the end of the batch file looks like..

          Code:
          if errorlevel 1 goto error
          if errorlevel 0 goto end
          
          :error
          echo This program encountered and error, please contact 
          echo the Administrator.
          
          :end
          echo File copy operation completed.
          exit
          Last edited by Dumber; 18th January 2006, 18:03.

          Comment


          • #6
            Re: Run a batch file @ shutdown

            added code arround it..
            Marcel
            Technical Consultant
            Netherlands
            http://www.phetios.com
            http://blog.nessus.nl

            MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
            "No matter how secure, there is always the human factor."

            "Enjoy life today, tomorrow may never come."
            "If you're going through hell, keep going. ~Winston Churchill"

            Comment


            • #7
              Re: Run a batch file @ shutdown

              sorry about that..
              Just to update things...When I test this on my XP machine, the exit command at the end of the file works, but it doesn't work on the windows 98 machine that the batch file is intended to be used on. ??
              Last edited by Solid; 18th January 2006, 21:55.

              Comment


              • #8
                Re: Run a batch file @ shutdown

                can you post you're complete script?
                Marcel
                Technical Consultant
                Netherlands
                http://www.phetios.com
                http://blog.nessus.nl

                MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
                "No matter how secure, there is always the human factor."

                "Enjoy life today, tomorrow may never come."
                "If you're going through hell, keep going. ~Winston Churchill"

                Comment


                • #9
                  Re: Run a batch file @ shutdown

                  Update, I got it to work! All I had to do was add CLS just before EXIT and this closed the window. Thanks for your help guys!

                  Comment

                  Working...
                  X