Page 1 of 1

BUG 800 - CMD for favourite toolbar in root directory not using correct parameter

Posted: 29.07.2019, 12:57
by stephen147
My code below works fine in any other path except a root path such as:
Z:\ or C:\

The cd %~d1 in line 3 below echos W:\Apps (Portable)\FreeCommanderXE
where my FC portable build is located when it should be:
Z:\ in this case.

All other directories work fine apart from root paths.

This results in the attrib +s "%%~G" failing in this case.

Code: Select all

@echo off
rem mode con:cols=15 lines=1
rem cds to current drive letter from the parameter set in the Define favourite toolbars.
cd %~d1
rem cds to current path from the parameter set in the Define favourite toolbars.
cd %~1
echo %~1 in this directory.
color 5F
chcp 65001 >NUL
echo.
echo.This will change the folders below to read-only.
for /f "tokens=*" %%G in ('dir "%~1\*" /AD-R-H /B /ON') do echo.→ %%~G
echo.
pause
for /f "tokens=*" %%G in ('dir "%~1\*" /AD-R-H /B /ON') do attrib +s "%%~G" && echo.Folder Done → %%~G
timeout /T 6
My toolbar settings are shown here:

Image