locked
A positional parameter cannot be found that accepts argument RRS feed

  • Question

  • Hi, I am trying to create a directory inside another one. I got the error mentioned in the title.


    mkdir p r o j e c t s
    cd p r o j e c t s /
    mkdir skeleton
    cd skeleton
    mkdir bin NAME t e s t s docs (here is where the error is displayed)

    Monday, February 24, 2020 4:09 AM

Answers

All replies

  • Plesae format you code as code How to Use the Code Feature in a TechNet Forum Post

    and when you get error messages yo ushould post the complete error message as well ... formatted as code as well, please.

    BTW: That's not Powershell code you posted. ;-) If you run this command lines in a CMD it will probably work. Did you check if the first commands worked? Is there a folder named "p r o j e c t s"


    Live long and prosper!

    (79,108,97,102|%{[char]$_})-join''

    • Edited by BOfH-666 Monday, February 24, 2020 7:17 AM
    Monday, February 24, 2020 7:14 AM
  • I don't think it will work from the Windows command line, either:

    https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/md

    Now, if it were run from a *nix shell it'll work:

    https://www.computerhope.com/unix/umkdir.htm

    The Windows "mkdir" (an alias for "md") only accepts one "<Path>".

    However, it will work in Powershell if the "-Path" parameter is specified as a list:

    mkdir projects
    cd projects/
    mkdir skeleton
    cd skeleton
    mkdir bin,NAME,tests,docs

    I suspect the spaces in the directory names are from copying multibyte Unicode characters.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    • Marked as answer by philosopher76 Tuesday, February 25, 2020 4:46 AM
    Monday, February 24, 2020 4:11 PM