I was playing around and executed the following .bat
@echo off
mkdir %~dp0
pause
This created two directories at the batch location:
- “and”
- “Settings” (inside this: “Usuario”, inisde this “Escritorio”, inisde this “123”)
Note: I executed the batch from a “123” directory
I want some background to understand what just happened
The
mkdircommand makes all the directories specified on the command line (separated by spaces). For example,will make the directories
fooandbar. In your case, the argument isC:\Documents and Settings\Usuario\Escritorio\123, equivalent to:Since
mkdirdoesn’t know any different, it thinks you want to create the three directories named:C:\DocumentsandSettings\Usuario\Escritorio\123You could try doing:
and see if the double quotes help.