• DOS batch file query

    Home » Forums » AskWoody support » Windows » Windows – other » DOS batch file query

    Author
    Topic
    #414313

    Not sure if this is the right place, to ask, but I’m looking for
    help in closing a .txt file that opens during my automated back-ups.

    I need to find a way to close it from within the DOS batch file
    which is controilling the process.

    Any suggestions please.

    Viewing 1 reply thread
    Author
    Replies
    • #919883

      The “obvious” answer would be to get the program that opens this TXT file to close it. Then the backup could back up everything successfully…

      You really need to say a bit more about the TXT file.

      John

      • #920018

        Thanks

        I had tried to look at the txt file – created by PestPatrol running in command line mode – but couldn’t see any option to close it from within PestPatrol.

        There is an option to stop it displaying however, so i can get round it that way, but it is not as convenient.

        Colin

        • #920209

          Can you stop PestPatrol while you’re doing the backups?

          John

          • #920219

            There about 6 to 8 individvidual Batch files which run each nite, doing defrags, spyclean, empty recycle etc. Each batch file does similar tasks, so the one I’m concerned with runs Ad-Aware, Spybot & Pest-Patrol each night, then archives the log files. Each of these progs is run in command-line format

            I use winzip to carry out the back-up elements, also controlled froma a command line interface.

            I’ve already edited the bat file to stop the .txt file opening in the first place.

            Colin

            • #920499

              Perhaps PSKill will do the job for you?

            • #920503

              I’ll have a look

              Colin

            • #920509

              Their web page suggests it is for NT/2000.

              Is it safe for XP ?

            • #920539

              Yes, but I don’t think it will do what you want.

              PSKILL “terminates processes on local or remote systems”…

              John

            • #920540

              Yes, but I don’t think it will do what you want.

              PSKILL “terminates processes on local or remote systems”…

              John

            • #920558

              Colin, Windows XP is just Windows 2000.1 if you look at the version numbers. I was wondering, though, if you wrote the batch file that is opening the log file. If so, what is the syntax that is causing it to open?

            • #920559

              Colin, Windows XP is just Windows 2000.1 if you look at the version numbers. I was wondering, though, if you wrote the batch file that is opening the log file. If so, what is the syntax that is causing it to open?

            • #920510

              Their web page suggests it is for NT/2000.

              Is it safe for XP ?

            • #920504

              I’ll have a look

              Colin

            • #920507

              Mark

              I thought he wanted to close a file, not terminate a process!

              John

            • #920556

              To be sure, John…killing notepad is one way to close the file! anigrin

            • #920734

              Where did NOTEPAD come into this? I thought it was PestPatrol which was creating the TXT file and holding it open!

              John

            • #920848

              Yes, but… it sounds like the .txt file is likely being “opened” by the default program associated with .txt files — and for 95% of users, that would be NotePad.

              OK, so it is a slight assumption, but I’ll bet it is correct. PestPatrol itself does not likely “open” the .txt file. Instead it more likely uses the associated program. Therefore, slamming shut NotePad should be successful.

            • #920921

              Colin hasn’t actually said what is in this TXT file. I have assumed that it is a form of LOG file (like the notorious SQL.LOG file) which is written to while PestPatrol is running (either a scan or as a resident “watcher”, perhaps).

              It would be fairly easy to see if NOTEPAD is running by looking at the Processes tab of Task Manager.

              However, I don’t have PestPatrol, so this is fairly speculative…

              John

            • #921070

              Agreed entirely.

              I don’t use Pest Patrol either, so I am speculating as well. If this process is occurring before Windows is shut down, perhaps even the program is obviously displayed.

              Either way, the offending program should be able to be identified — and then “TaskKilled” (I would hope).

            • #921071

              Agreed entirely.

              I don’t use Pest Patrol either, so I am speculating as well. If this process is occurring before Windows is shut down, perhaps even the program is obviously displayed.

              Either way, the offending program should be able to be identified — and then “TaskKilled” (I would hope).

            • #920922

              Colin hasn’t actually said what is in this TXT file. I have assumed that it is a form of LOG file (like the notorious SQL.LOG file) which is written to while PestPatrol is running (either a scan or as a resident “watcher”, perhaps).

              It would be fairly easy to see if NOTEPAD is running by looking at the Processes tab of Task Manager.

              However, I don’t have PestPatrol, so this is fairly speculative…

              John

            • #920849

              Yes, but… it sounds like the .txt file is likely being “opened” by the default program associated with .txt files — and for 95% of users, that would be NotePad.

              OK, so it is a slight assumption, but I’ll bet it is correct. PestPatrol itself does not likely “open” the .txt file. Instead it more likely uses the associated program. Therefore, slamming shut NotePad should be successful.

            • #920735

              Where did NOTEPAD come into this? I thought it was PestPatrol which was creating the TXT file and holding it open!

              John

            • #920557

              To be sure, John…killing notepad is one way to close the file! anigrin

            • #920508

              Mark

              I thought he wanted to close a file, not terminate a process!

              John

            • #920500

              Perhaps PSKill will do the job for you?

          • #920220

            There about 6 to 8 individvidual Batch files which run each nite, doing defrags, spyclean, empty recycle etc. Each batch file does similar tasks, so the one I’m concerned with runs Ad-Aware, Spybot & Pest-Patrol each night, then archives the log files. Each of these progs is run in command-line format

            I use winzip to carry out the back-up elements, also controlled froma a command line interface.

            I’ve already edited the bat file to stop the .txt file opening in the first place.

            Colin

        • #920210

          Can you stop PestPatrol while you’re doing the backups?

          John

      • #920019

        Thanks

        I had tried to look at the txt file – created by PestPatrol running in command line mode – but couldn’t see any option to close it from within PestPatrol.

        There is an option to stop it displaying however, so i can get round it that way, but it is not as convenient.

        Colin

    • #919884

      The “obvious” answer would be to get the program that opens this TXT file to close it. Then the backup could back up everything successfully…

      You really need to say a bit more about the TXT file.

      John

    Viewing 1 reply thread
    Reply To: DOS batch file query

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: