Problem passing parameters by ref in for /R
Posted: 22 Nov 2023 05:10
Hi,
I have this problem
The first procedure create_folder0 with parameters by value work
The second create_folder1 with name of variable don't work
It simple but i don't know where I worng
I have this problem
The first procedure create_folder0 with parameters by value work
The second create_folder1 with name of variable don't work
It simple but i don't know where I worng
Code: Select all
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal EnableDelayedExpansion
set "Origin=J:\Video\Generi_Video"
call :create_folders0 "!Origin!"
pause
call :create_folders1 Origin
pause
goto :eof
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SUBS
:create_folders0
for /R "%~1" %%D in (*.*) do echo working...
echo "%~1"
goto :eof
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:create_folders1
for /R "!%~1!" %%D in (*.*) do echo working...
echo "!%~1!"
goto :eof