в таком виде:
Цитата:
rem %%~nx
echo %%~nx
set var = file
Код:
Код: Выделить всё
pushd "C:\111"
for /f "delims=" %%x in ('dir /b/s/a-d "*.txt"') do (
rem %%~nx
echo %%~nx
set var = %%~nx
)
popd
pauseКод: Выделить всё
pushd "C:\111"
for /f "delims=" %%x in ('dir /b/s/a-d "*.txt"') do (
rem %%~nx
echo %%~nx
set var = %%~nx
)
popd
pause
Код: Выделить всё
cmd /c echo text %%%%^^%^^%~na text
echo text %%%%^^%^^%~na text
Код: Выделить всё
rem %%~nx
echo %%~nxКод: Выделить всё
rem ^%^%^~nx
echo ^%^%^~nxКод: Выделить всё
@Echo Off
cls
Set "Var=%%%%~nx"
Echo "%Var%"
pauseКод: Выделить всё
@Echo Off
cls
Set "Var=%%%%~nx"
for /f "delims=" %%x in ('dir /b/s/a-d "*.txt"') do (
Call Echo %%Var%%=%%~nx
)
pauseКод: Выделить всё
Call Echo %%Var%%=%Var%Код: Выделить всё
pushd "C:\111"
Set "Var1=%%%%~nx"
Set "Var2=%%%%~fx"
Set "Var3=%%%%~dx"
for /f "delims=" %%x in ('dir /b/s/a-d "*.txt"') do (
Call Echo %%Var1%% text %%Var2%% text %%Var3%%
rem %%Var1%% text %%Var2%% text %%Var3%%
)
pauseКод: Выделить всё
pushd "C:\111"
for /f "delims=" %%i in ('dir /b/s/a-d "*.txt"') do (
rem %%%%~nx
echo %%%%~nx
set var = %%%%~nx
)
pauseКод: Выделить всё
@Echo Off
cls
Set "Var=%%%%~"
for /f "delims=" %%x in ('dir /b/s/a-d "*.txt"') do (
Call Echo %%Var%%nx=%%~nx %%Var%%nxx=%%~nxx %%Var%%zx=%%~zx
)
pauseКод: Выделить всё
@echo off
setlocal enableextensions enabledelayedexpansion
pushd "C:\Мои проекты\0254" && (
for /f "delims=" %%x in ('dir /b /s /a:-d "*.txt"') do (
Код: Выделить всё
Set "Var=%%%%~"Код: Выделить всё
@echo off
for /f "delims=" %%a in ('dir /a-d/b/s "*.txt"') do (
set "name=%%~na"
cmd /c echo var_for %%%%^^%^^%~na=%%~na
echo var %%name%%=%%~na
call echo zn [%%name%%]=%%~na
echo:
)
pause