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

Discussion and questions - donor version.
Post Reply
Message
Author
stephen147
Posts: 153
Joined: 18.10.2015, 14:44

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

#1 Post by stephen147 » 29.07.2019, 10:57

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
Sceenshots made easy with ShareX.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests