WOPR
WOPR

Reputation: 81

Cmd command "mkdir" does not create a new directory

I'm working in the Windows cmd environment and I'm having some problems with the use of mkdir/md command.

I thought the following use of mkdir command was supposed to create a new directory inside the existing dir1, instead that's what I got:

C:\Users\John> cd desktop\dir1
C:\Users\John\Desktop\dir1> mkdir newdir
cannot find path specified.

Specifing the entire directory starting from C: drive, returns the same message:

C:\> mkdir C:\Users\John\Desktop\dir1\newdir
cannot find path specified.

While, if I use the same command in the C drive or John sub-directory, there aren't any problems and new directories are created:

C:\> mkdir dir1
C:\> cd Users\John
C:\Users\John> mkdir dir1
C:\Users\John> cd dir1
C:\Users\John\dir1>_

Strangely, if I manually create a directory named "newdir" inside dir1, the same command behave normally, and like in the above snippet, no message is returned:

C:\Users\John\desktop\dir1>mkdir newdir
C:\Users\John\desktop\dir1>_

It seems the mkdir/md command behaves as expected only in the root directories "C:" and "John" while, in other subdirectories, it performs some kind of search for the specified directory and, if existing, no message are shown, while if it's not the "Cannot find path specified" message is returned.

What is the problem?

P.S.:

I get a similar problem with the "rd" command, resulting in an "access denied" if used in minor subdirectories (like dir1), but successful if used in root directories, just like "John" or in the "C:\" drive top directory.

Upvotes: 1

Views: 16073

Answers (1)

WOPR
WOPR

Reputation: 81

The problem is resolved. Windows 10's built-in firewall created some kind of permission limits for cmd.exe...

All I had to do was to add cmd.exe in the app exception for Windows Firewall, in order to grant elevated permissions to the application.

Upvotes: 4

Related Questions