Windows 10: broken batch files

Discus and support broken batch files in Windows 10 Installation and Upgrade to solve the problem; ok, so for a while I have been using a simple script: :top shutdown -a shutdown -s -t 3600 timeout /T 3600 goto top to set a 1 hour shutdown... Discussion in 'Windows 10 Installation and Upgrade' started by redyandsalted, Aug 10, 2019.

  1. broken batch files


    ok, so for a while I have been using a simple script:


    :top

    shutdown -a

    shutdown -s -t 3600

    timeout /T 3600

    goto top

    to set a 1 hour shutdown timer, and make it restart if needed with a single click. But after updating to OS build 18956.1000 the file has completely broken! With it simply spamming the second line "shutdown -a" over and over again, then when this is ran:


    :top

    shutdown -s -t 2393

    echo 1

    pause

    goto top


    it does the same thing, whilst this:


    :top

    echo 1

    echo 2

    pause

    goto top



    works perfectly fine, also, the shutdown command doesn't actually go through, so not even the command works! This problem appears in both .bat and .cmd files. And one more thing, just:


    shutdown -s -t 304


    just spams the shutdown command without ever running it. I really can't for the life of me figure out why this is happening or how to fix it...

    :)
     
    redyandsalted, Aug 10, 2019
    #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, Aug 10, 2019
    #2
  3. Batch Files Knowledge Base

    Very nice and usefull thanks for contributing.
     
    AphexDreamer, Aug 10, 2019
    #3
  4. Steevo Win User

    broken batch files

    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, Aug 10, 2019
    #4
Thema:

broken batch files

Loading...
  1. broken batch files - Similar Threads - broken batch files

  2. Comments in batch files

    in Windows 10 Network and Sharing
    Comments in batch files: Is there a way to comment out lines in a Windows .bat or .cmd file? Sorry, but I'm drawing a blank on this basic question. https://answers.microsoft.com/en-us/windows/forum/all/comments-in-batch-files/bb73da92-5bfc-41ff-9d59-c1b82de2c0d8"
  3. Batch Folder and Batch File/Move Software

    in Windows 10 Software and Apps
    Batch Folder and Batch File/Move Software: Looking for recommendations for software that handles automatic batch folder creation according to defined rules. Also looking for software that handles automatic file and folder moving into more than one directory according to selection criteria (size, date, extension,...
  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. Microsoft Batch Files

    in Windows 10 Customization
    Microsoft Batch Files: Hello Folks! Can someone help me create a batch script with the below basis? Stop a Windows service and if the service doesn't stop successfully it will do the taskkill to force stop and then restart the service afterwards. I can do the Stop and start command but I...
  6. Media / Batch Files

    in Windows 10 Installation and Upgrade
    Media / Batch Files: Hello Microsoft, and other people viewing this post / question. There is no possible way (except with SOUND.exe, only compatible with old versions of Windows) to run media without the media player showing up. Microsoft, if you're reading this, if you make another version of...
  7. Batch File Problem

    in Windows 10 Support
    Batch File Problem: So I want to backup my saved game files after each time I play, as there is a bug after the latest patch that can delete your saves. Figured better to be safe then sorry. Now I found the following online and edited to my info... Code: @echo off cd "D:\Must Keep\Game & Other...
  8. 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...
  9. Startup batch file

    in Windows 10 Support
    Startup batch file: When Windows 10 starts, a DOS window appears, runs: C:\Users\Brian\AppData\Local\854e8f7.bat , then disappears. The .bat file contains: start "plqcknRlU67iM4TfEXQq" "%LOCALAPPDATA%\b183312\88d4f24.21b2bbd3" There are two files in C:\Users\Brian\AppData\Local\...
  10. Writhing Batch File

    in Windows 10 Support
    Writhing Batch File: Here is my batch file but it will not delete the file? Must be missing something *Sad del "C:\Users\Larry\AppData\Local\TractorParts\tractor\ConfigSetting" Trying to delete the ConfigSetting File 36240