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 at 2:26 AM.

  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?

    :)
     
  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.
     
  3. Batch Files Knowledge Base

    Very nice and usefull thanks for contributing.
     
    AphexDreamer, Jan 14, 2020 at 2:53 AM
    #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
     
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. 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...
  3. Where can I find information on Win10 Batch Files

    in Windows 10 Network and Sharing
    Where can I find information on Win10 Batch Files: Where in MS knowledgebase can I find info on programming batch files https://answers.microsoft.com/en-us/windows/forum/all/where-can-i-find-information-on-win10-batch-files/84dd7b40-5cfc-46ec-a496-2ea5449c3f19"
  4. batch file

    in Windows 10 Network and Sharing
    batch file: I want a BAT file to be executed when a USB plugged in to the PC. How can I do it? https://answers.microsoft.com/en-us/windows/forum/all/batch-file/1af5ec02-b6c8-4916-959b-ed0327a964e7"
  5. how can i disable read only feature on folders effectively

    in Windows 10 Customization
    how can i disable read only feature on folders effectively: I have been tryin g to disable read only feature on my folders by unchecking the the read only box but it wont work even when I changed the user to administrator it just doesn't change any advice?...
  6. Batch File Help

    in Windows 10 Software and Apps
    Batch File Help: I've never dabbled much in batch files, as I've usually been able to find pre-made ones to do what I wanted. We have an application that handles user data backups. It has three services, and at times, one or two of the three don't start automatically. If you stop and start...
  7. Batch file: Who can solve this mystery?

    in Windows 10 Software and Apps
    Batch file: Who can solve this mystery?: I recenty migrated to Windows 10 from XP. Years ago, I made a batch file, ping.bat, to test my Internet connection and DNS server: ping 98.139.183.24 ping yahoo.com ping nytimes.com pause It works fine in XP, but when I run it in Windows 10, it goes into an endless...
  8. How to run batch file with powershell

    in Windows 10 Network and Sharing
    How to run batch file with powershell: I created a basic batch file that uses "net share" to share a local path. I saved the batch file. When I double click the file I get "access is denied"... note, I am logged on as a admin. Anyways... I figure it has to be run using power shell. I do not know much about...
  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