Page 1 of 1
Windows 10 BRC CLI cannot clear file attributes
Posted:
Fri Jan 10, 2020 7:37 am
by spellng
Hi,
I'm running Windows 10 Pro - using a batch file to perform many renaming operations - everything works fine on files I manually name for testing in my test folder.
Nothing gets renamed when I run the batch file on my target folders with lots of files.
I determined that the files have the "archive" attribute checked for some reason - and the folder has a "read-only attribute box checked too.
When I uncheck these boxes and click apply all the files attributes are removed and my batch file works.
I cannot seem to get BRC CLI to remove these attributes.
I tried:
/recursive /clearr /cleara
but the attributes are not removed.
I can't seem to rename any files until the attributes are cleared.
Any help would be great.
Re: Windows 10 BRC CLI cannot clear file attributes
Posted:
Fri Jan 10, 2020 1:37 pm
by therube
What command line are you using?
Are you using INCLR?
- Code: Select all
INCLR - Include ReadOnly items (excluded by default)
With that, you do not (necessarily) need to use CLEARR.
(The archive attribute should not be an issue at all.)
Re: Windows 10 BRC CLI cannot clear file attributes
Posted:
Fri Jan 10, 2020 4:46 pm
by spellng
Hi,
Thanks - your solution worked.
This will remove the attributes:
- Code: Select all
echo step 1 of 7 remove attributes
brc64.exe /D:"D:" /recursive /inclr /inclh /clearr /cleara /quiet /execute
timeout /t 10
I created a batch file that runs multiple rename operations - the pauses let me see the progress in the explorer window - yes, I am including hidden files.
Thanks again for the great help.
Re: Windows 10 BRC CLI cannot clear file attributes
Posted:
Fri Jan 10, 2020 7:17 pm
by spellng
Hi again,
Sorry, ignore my positive response above - turns out that the /inclr and /clearr switches for brc64.exe cli appear NOT to work on my Windows 10 Pro 1909 machine.
I have created two nested test folders with test files and have explorer showing me the details window with an attributes column.
brc64.exe cli with switch /inclr will NOT rename files that have an R - read only.
brc64.exe cli with switch /inclr /clearr does not remove the read-only attribute.
I cannot use brc64.exe cli to remove the read-only attribute.
The only way I can remove the read-only attribute is to uncheck it in the explorer properties window and then the progress bar appears as all the files get modified.
Once the R attribute is removed renaming works.
I don't remember having this problem the last time I used br64.exe a few months back.
Am I missing something obvious?
Please help.
Re: Windows 10 BRC CLI cannot clear file attributes
Posted:
Fri Jan 10, 2020 9:33 pm
by spellng
Hi,
I think I found a solution - I run the following windows command to flip the attributes to off
- Code: Select all
attrib -r D:\stuff_to_rename\*.* /s
I added this line at the beginning of my batch script and it flips all the read-only attributes to off of all files and renaming proceeds to work great - even on all subfolders.
Thanks.
Re: Windows 10 BRC CLI cannot clear file attributes
Posted:
Sat Feb 01, 2020 9:47 am
by bru
Hi, the /Clear and /Set-commands only process after a successful rename.
The command-line you posted doesnt rename anything, so no attributes would change.
I figured for simplicity, you might have omitted the rest of the command?
Can you please confirm?
I've been trying to duplicate using:
brc64 /Recursive /NoFolders /InclH /InclR /ClearH /ClearR /Suffix:-KilledAttributes /Execute
brc64 /Recursive /NoFolders /SetH /SetR /RemoveWords:-KilledAttributes /Execute
Both commands always succeed to clear/set the attributes, but I'm on Win8.1
Thanks.