Getting full (or short) folder name with white space in loop
Hello, I’m tiring to get all folder name and only folder in loop. I have problem because folder name have whitespace. My loop
for /f %%a in ('dir /b /ad') do (
ECHO "%%a"
)
So if folder name is e.g. “Folder name 1” I’m getting only “Folder”. So how to get full folder name?
I think if I get short name e.g. “Folder~1” also will by good.
I’m need this because I’m trying to write some script which adding user privileges to folders and I’m using for this XCACLS
Ps. Sorry for my horrible English.
Getting full (or short) folder name with white space in loop
Moderator: DosItHelp
Re: Getting full (or short) folder name with white space in
ernest211 wrote:Hello, I’m tiring to get all folder name and only folder in loop.
Code: Select all
for /d %%a in (*) do echo.%%a
ernest211 wrote:So if folder name is e.g. “Folder name 1” I’m getting only “Folder”. So how to get full folder name?
Code: Select all
for /f "delims=" %%a in ('dir /b/ad') do echo.%%a