RosettaCodeData/Task/Make-directory-path/Batch-File/make-directory-path.bat
2026-04-30 12:34:36 -04:00

21 lines
358 B
Batchfile

@echo off
choice /M "Custom implementation?"
if errorlevel 2 goto native
goto custom
:native
md %~1
goto:eof
:custom
::pushd stack will be discarded at endlocal or EOF
setlocal
set "dirpath=%~1"
set dirpath="%dirpath:\=" "%"
::resolve \ (filesystem root) at the start
set "dirpath=%dirpath:"" "="\%"
for %%i in (%dirpath%) do (
md %%i
pushd %%i
)
goto:eof