In a batch file, I'm trying to capture the short subdirectory name. The long name is in the variable %FCdir%. The following have been tried:
for %%I in ( %FCdir% ) do (set FCdir=%%~sI)
FOR %%A IN ("%FCdir%") DO ECHO %%~sA
FOR /d /r . %%d IN (%FCdir%) DO echo ... %%~sd
For testing, set FCdir=#ReadRite
It seems all answers so far are along this line ... \#ReadR~1\#ReadRite ... a full path. Ideas how to get just '#ReadR~1'?
Thanks,
Phil
How to capture a subdirectory's short subdirectory's name?
Moderator: DosItHelp
-
- Posts: 6
- Joined: 22 Nov 2014 07:56
- Location: Medford, Oregon
- Contact: