I am very new to Command script please help in below question.
I have below for loop which returns the paths of the files available in C:\test folder and its subfolders. I want the directory path from the file path For example.
If for loop returns C:\test\scripts\sample.txt but i want only C:\test\scripts. for this i have written below command to
For /R C:\seq\ %%a IN (*) do (
set filename="%%a"
echo %filename%
)
This is not assigning file path to variable filename so i can get directory path out of it. Please help in getting directory path from file path in batch scripting.
for /?especially the~-modifiers