Windows 10: Batch File Hangs. How Can I Effectively End It?

Discus and support Batch File Hangs. How Can I Effectively End It? in Windows 10 Software and Apps to solve the problem; My machine is on v1909 (OS Build 18363.535). I run a batch file each night to close my Outlook process in preparation for nightly backup. It is, in... Discussion in 'Windows 10 Software and Apps' started by chasfh, Jan 14, 2020.

  1. chasfh Win User

    Batch File Hangs. How Can I Effectively End It?


    My machine is on v1909 (OS Build 18363.535).

    I run a batch file each night to close my Outlook process in preparation for nightly backup. It is, in fact, a batch file located here: Closing Outlook via a (scheduled) script - HowTo-Outlook. The specific script I am running is closeoutlookfailsafe.vbs, and I execute it as a cscript out of the batch file.

    It does execute what it is supposed to do, which is closing down Outlook, but then the CMD window hangs open and, within Task Scheduler, the process status maintains as "Running" indefinitely, until the machine shuts down after executing the backup process.

    I've been looking around for a way to gracefully end the batch process in such a way that the CMD window closes and the status resets to "Ready", but I am coming up dry. To be clear, the exact language in the batch file is:

    cscript.exe "C:\Users\[name]\Documents\Outlook Files\Close Outlook Scheduled Task Files\CloseOutlookFailsafe.vbs"

    Does anyone have any feel as to whether I can accomplish what I am looking to do here?

    :)
     
    chasfh, Jan 14, 2020
    #1
  2. oily_17 Win User

    Batch Files Knowledge Base

    Don't use batch files very much but one I find useful is for creating a list of files in a directory.
    Just copy the text below into Notepad and save as Filelist.bat

    dir /a /-p /o:gen >filelist.txt

    When you run it from a folder it will create a Filelist.txt file,in the same folder, that lists all the files in that folder.Useful when you are too lazy to type all the files out yourself.
     
    oily_17, Jan 14, 2020
    #2
  3. Batch Files Knowledge Base

    Very nice and usefull thanks for contributing.
     
    AphexDreamer, Jan 14, 2020
    #3
  4. Steevo Win User

    Batch File Hangs. How Can I Effectively End It?

    Batch file to ping network

    No, batch files are extremely easy.

    A "If" requires three extra steps.

    Code is not how much you can put in, but how lite can you make it and still perform the functions.

    So

    @ echo off


    ping 1.4.1.4 >a.txt

    findstr /m "Request timed out" a.txt
    if %errorlevel%%==0 (
    echo Save our nets!!!
    )

    pause
     
    Steevo, Jan 14, 2020
    #4
Thema:

Batch File Hangs. How Can I Effectively End It?

Loading...
  1. Batch File Hangs. How Can I Effectively End It? - Similar Threads - Batch File Hangs

  2. Can Robocopy copy in batches of files?

    in Windows 10 Gaming
    Can Robocopy copy in batches of files?: Evening, I'm just after a bit of help, I have a folder on my PC which has a load of files from my Nikon Camera - for my current example 1700 at around 42GB, I usually copy these to an external SDD but I'm guessing due to the SSD the speed tends to drop off so I start around...
  3. Can Robocopy copy in batches of files?

    in Windows 10 Software and Apps
    Can Robocopy copy in batches of files?: Evening, I'm just after a bit of help, I have a folder on my PC which has a load of files from my Nikon Camera - for my current example 1700 at around 42GB, I usually copy these to an external SDD but I'm guessing due to the SSD the speed tends to drop off so I start around...
  4. How do I create a batch file that listens to a process and once it"s ended, it logs the...

    in Windows 10 Gaming
    How do I create a batch file that listens to a process and once it"s ended, it logs the...: In windows 10 Pro editionBasically I have set up a guest user account with standard user privileges that has a custom user interface - "shell"- called Playnite which is a game library.Tested if it works, works perfectly. However, I need a batch file that would listen to the...
  5. How do I create a batch file that listens to a process and once it"s ended, it logs the...

    in Windows 10 Software and Apps
    How do I create a batch file that listens to a process and once it"s ended, it logs the...: In windows 10 Pro editionBasically I have set up a guest user account with standard user privileges that has a custom user interface - "shell"- called Playnite which is a game library.Tested if it works, works perfectly. However, I need a batch file that would listen to the...
  6. How do I create a batch file that listens to a process and once it"s ended, it logs the...

    in Windows 10 Customization
    How do I create a batch file that listens to a process and once it"s ended, it logs the...: In windows 10 Pro editionBasically I have set up a guest user account with standard user privileges that has a custom user interface - "shell"- called Playnite which is a game library.Tested if it works, works perfectly. However, I need a batch file that would listen to the...
  7. how can i delete transparency effects

    in Windows 10 Customization
    how can i delete transparency effects: how can I delete transparency effects https://answers.microsoft.com/en-us/windows/forum/all/how-can-i-delete-transparency-effects/82188b6d-e200-4ee6-8a27-c6510683a511
  8. How to Batch Rename files ?

    in Windows 10 Software and Apps
    How to Batch Rename files ?: I have a lot of files i want to give names to. I already found a way to get names into a text I need. So all these names i have in text, i want to give to other files. How do i do this in a batch process ? Currently trying to learn FastStone Image viewer. Seems to be...
  9. How to change visual effects using batch file or registry file?

    in Windows 10 Support
    How to change visual effects using batch file or registry file?: Hi there forum, how do you change the Visual effects using a batch file or registry file. Thanks, Edward. 52995
  10. Can a batch file be pinned to the taskbar?

    in Windows 10 Support
    Can a batch file be pinned to the taskbar?: Right clicking a batch file on my desktop does not give me the option to pin it, is there a way? Thanks! 57501