1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

TIMEOUT no longer waits as stated

Discussion in 'Windows 11' started by Ludwig, 2023/03/22.

  1. 2023/03/22
    Ludwig

    Ludwig Well-Known Member Thread Starter

    Joined:
    2002/01/07
    Messages:
    146
    Likes Received:
    0
    I have two batch files that have works for years. All of a sudden, the lines within to execute TIMEOUT for a short period rarely actually function now like they used to - they just exit as if time was set to "0" seconds. And no, I haven't anything touched any key on the keyboard to tell it to stop waiting.

    The annoying thing is .. sometimes they work. For example, open CMD.exe and type TIMEOUT /t 5 works - you see the countdown happening before you can enter another command.

    In the batch files, the command rarely works any more. It usually fails to wait - it displays the first value e.g.

    Waiting for 8 seconds, press a key to continue ...

    and then immediately exits and runs the next command (which while I was diagnosing was a "pause").

    Even replacing the call with "%SystemRoot%\System32\timeout.exe /T 8" as was suggested in some internet search results makes no difference - it still does not wait for (eg) 8 seconds or keyboard input.

    Has anyone else experienced this? Does anyone know how to make things work again "as designed"?
    Thanks.
     
  2. 2023/03/22
    MrBill

    MrBill SuperGeek WindowsBBS Team Member

    Joined:
    2006/01/14
    Messages:
    4,331
    Likes Received:
    270
    Can't find the article right off hand, but M$ admits that their updates are causing all kinds of problems in Win 11. From SSD drives not working and other crazy stuff. Just a thought.
     

  3. to hide this advert.

  4. 2023/03/23
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,317
    Likes Received:
    252
    Are your batch files named .bat

    If so, try changing it to .cmd and see if that makes any difference.

    And or - does running the batch file as an administrator help?
     
  5. 2023/03/23
    Ludwig

    Ludwig Well-Known Member Thread Starter

    Joined:
    2002/01/07
    Messages:
    146
    Likes Received:
    0
    The files are both .CMD already. A few "runs" of the CMD files as an Administrator just now all worked (mutter mutter). The problem is the files the CMD files access are in the "Download" folder" and are relative to the root user directory i.e. C:\Users\<username>\. Hence the CMD file will look at the wrong location to [fail to] achieve it's objective.

    Good to know it seems admin privilege makes TIMEOUT work in a batch CMD file but doesn't resolve making it work as it has in the past couple or more years it has been working for a std user.
     
  6. 2023/03/23
    Steve R Jones

    Steve R Jones SuperGeek Staff

    Joined:
    2001/12/30
    Messages:
    12,317
    Likes Received:
    252
    The batch file should look in whatever folder you tell it to look in.
     
  7. 2023/03/23
    Ludwig

    Ludwig Well-Known Member Thread Starter

    Joined:
    2002/01/07
    Messages:
    146
    Likes Received:
    0
    I have found what appears to be a circumvention for the problem.

    If I code a second TIMEOUT /T 5 (or whatever) in the CMD file, it works as shown in the following screenshot of a sample CMD file. The first call doesn't count down, the second does. Using full path or not doesn't matter (I reversed the calls and same effect happens - 1st fails, 2nd works).
    Screenshot 2023-03-24 101856.png

    So I've coded a TIMEOUT /T 1 at the start of my otherwise working CMD files; it fails as 'expected' but the subsequent & 'real' use of TIMEOUT works. Not a proper solution, but at least it seems to avoid the problem.
    I use timeout to show an error/informational msg before exiting hence my CMD files have only ever invoked one instance of TIMEOUT.

    NB: if I open CMD.EXE and manually type in a TIMEOUT /T n command, it works without need for a second one. It's just in a CMD file that it happens.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.