Is doskey broken in microsoft/windowsservercore containers RRS feed

  • Question

  • Hello

    No matter which format I us, the doskey command always returns "Invalid macro definition."

    C:\>doskey test=dir
    Invalid macro definition.

    C:\>echo "test=dir" > macro.txt

    C:\>doskey /MACROFILE=macro.txt
    Invalid macro definition.

    Is the command broken ?

    When I run it from my desktop it works fine

    Thursday, October 25, 2018 6:54 AM

All replies

  • Greetings,

    I can confirm this after running docker run -it --rm microsoft/windowsservercore:ltsc2016 cmd.

    Maybe doskey is not compatible with Windows Container. But I cannot find any document for you to explain it.

    So please report this issue at and @Patrick ( to get further support from Windows Dev team. :)

    Or you can share the full scenario with us, maybe we can help you to find a workaround without using doskey.

    Sic Parvis Magna

    Friday, October 26, 2018 1:25 AM
  • Thanks Huajun.

    The scenario is simple, we do have a startup cmd script using a doskey macrofile that is basically broken when running it from a container.

    I opened an issue ( but a workaround would be much appreciated!


    Sunday, October 28, 2018 7:28 AM
  • Greetings,

    A general workaround is trying to use commands directly in Dockerfile rather than macrofile.

    Also, PowerShell can also be considered.

    Sic Parvis Magna

    Sunday, October 28, 2018 1:27 PM
  • Not sure I got it, you mean executing the doskey commands in the Dockerfile instead of from inside ?

    if it is what you mean, the issue is the same

    Sending build context to Docker daemon  2.096GB
    Step 1/2 : FROM microsoft/windowsservercore
     ---> f8dc15f55717
    Step 2/2 : RUN cmd.exe /k doskey ttt=dir
     ---> Running in f80fe40d0a43
    Invalid macro definition.

    C:\> ---> 7b93297dfc3c
    Removing intermediate container f80fe40d0a43
    Successfully built 7b93297dfc3c

    • Edited by Betsamee Monday, October 29, 2018 7:35 AM
    Monday, October 29, 2018 7:29 AM
  • Greetings,

    I mean the actual commands (like ftp, nslookup, ipconfig) that are using in the macrofile.

    Maybe they can be replaced with PowerShell script with low cost.

    Sic Parvis Magna

    Tuesday, October 30, 2018 12:53 AM