How To Get Short File Names In For?

Msoft / Home premium sp1
March 7, 2009 at 20:16:05
Specs: Windows Vista
How can i get the /r switch of the 'for' to return short filenames?

the following dos command works great, EXCEPT when the target directory contains more than 8 chars.

for /r /d %%d in (*) do command /c dir /b %%d\temp

for reasons known only to my rabbi, i want to run this command with short file names.

that is why i'm using the command /c structure.

actually, i'm using short file names to try to overcome the 'too long filename' error on deep directories.

apparently, lfnfor used to be available, but no longer.

See More: How To Get Short File Names In For?

Report •

March 7, 2009 at 20:47:53
possible solution: ~s

it works here:
for /r /d %%d in (*) do %%~sd

but not here:
for /r /d %%d in (*) do command /c dir /b %%~sd\temp

why would that be?

Report •
Related Solutions

Ask Question