Home>

In order to learn PHP, in the process of creating a local development environment, when I was typing code in the Power shell, when I restarted, all the written contents disappeared and I retyped it like this I got an error and I couldn't move on.

mkdir: An item with the specified name C: \ Windows \ system32 \ MyVagrant already exists.
Occurrence line: 1 character: 1
+ mkdir MyVagrant
+~~~
+ CategoryInfo: ResourceExists: (C: \ Windows \ system32 \ MyVagrant: String) [New-Item], IOException
+ FullyQualifiedErrorId: DirectoryExist, Microsoft.PowerShell.Commands.NewItemCommand

Does this mean that there is still data on the power shell that was last entered? I thought, I looked for various files, but I do not understand well, google on the net and create a new file? I saw a site that looked like this, but I couldn't understand what was written by my knowledge, so I asked a question on this site

  • Answer # 1

    The content of the error is "mkdir: The specified name C: \ Windows \ system32 \ MyVagrant item already exists" is output, and the first "mkdir" is a command to create a directory.
    So I tried to create a "C: \ Windows \ system32 \ MyVagrant" directory with the "mkdir" command, but it already exists! That means ...
    I think the following procedure is a good solution.

    Rename the directory "C: \ Windows \ system32 \ MyVagrant" (eg "MyVagrant-old")

    Restart your PC.

    Run the Power Shell code again.

    When the error disappears, delete the directory "MyVagrant-old".

    If you don't fix it, you should check the contents of the running Power Shell code.