• Re: Interesting quirk of Windows on how it handles the "echo." command

    From R.Wieser@address@is.invalid to alt.msdos.batch,alt.comp.os.windows-10,alt.comp.os.windows-11 on Mon Aug 25 08:49:21 2025
    From Newsgroup: alt.comp.os.windows-11

    Arlen,

    3. But the "echo." erred when the batch file is run from the
    cmd line.
    'echo.' is not recognized as an internal or external command,
    operable program or batch file.

    Have you checked if that command is actually the culprit ?

    You should get the same error message when "echo." is the only line in the batchfile. If not than something else is going on.

    This causes it to be launched via cmd.exe /c, but without
    the usual batch file context and that changed how certain
    commands behave.

    What is, according to you, a "batch file context" ?

    Also, the "echo" command is an internal one. As long as cmd.exe is
    executing the batch file its available.

    Furthermore, its possible that although "echo." is mentioned as the culprit the actual error is in one of the lines just before it.

    Have you tried to place a space between "echo" and "." ? What happens ?
    What happens when you put another command ("echo [%comspec%]", "dir *.*", etc.) just before the "echo." commands in your batchfile ?

    iow, you have found a work-around for the problem, but you have not found
    the problem itself. It could hit you again at any time.

    Regards,
    Rudy Wieser

    p.s.
    I wrote "[%comspec%]" and ment it that way, including the brackets. If the enclosed variable doesn't contain anything you should /at least/ get two brackets. In the case it contains one (or more!) spaces you will see that too.


    --- Synchronet 3.21a-Linux NewsLink 1.2