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