brana wrote:Hi all,
I am using BRC command line tool to rename my files and folders
before moving to OneDrive for Business sync folder.
My BRC command removes the '.' (period) if the name is like ABC.TEST.txt and renames it to ABCTEST.txt.
It always leaves one '.' (period).
Unfortunately I don't know how to resolve it, but my command is missing it.
For example folder name ".nuget" or file name ".gitattributes" remains unchanged. And after I move it to sync folder, it fails to sync.
OneDrive sync folder does not like folder names or file names which starts from '.' (period).
I want to remove starting "." with some other characters like "_" from BRC command.
Here is the command I am using to strip out unnecessary symbols from Favorites folder.
"C:/> BRC32 /DIR: C:\Favorites /STRIPSYMBOLS /RECURSIVE /NODUP /Execute"
Hi brana,
Firstly, please note that this is the BRU forum, not the one for BRC.
Secondly, please use a more descriptive subject line... It's all here about "Folder and Files Rename"
Thirdly, please don't write prose. Take more effort into your questions and write short and clear sentences,
so everyone can follow even without much English language skills. A few line breaks now and then can't hurt either.
Fourthly, such names as ".gitattributes" and ".nuget" with leading dot and without extension,
are taken from both "DOS" and BRC as file names with extension only, having no base name at all.
But you can utilize the newer MS scripting language "PowerShell":
Open a PowerShell console.
Browse to your main folder.
Type in:
DIR .* | ForEach{ rename-item $_ ($_ -replace("\.","") ) }Press Enter key.
EDIT:
Special for your case try:
DIR C:\Favorites\.* -recurse | ForEach{ rename-item $_ ($_ -replace("\.","") ) -WhatIf }HTH?