yesterday i merged two drive (D: empty and E: my data) with the EASEUS partition master in WinPE. but it failed and then i realized that 70% of my data was moved to a folder (D:\Local Disk E_72420221840) and 30% still remain in E. then copied all the data to a new disk and deleted partitions and created a new partition with a cluster size of 64KB, then restored my previously copied data to the new partition, then noticed that all my custom icons for the folders are gone. after some searching i found problem. The read-only attribute is set to all folders by default, and its necessary to display the custom icon specified in desktop.ini. but none of my folders have the read-only flag, so i tested below code
attrib +R "foldername"
and it worked (custom icon appeared again) but i have 600GB of data with lots of folders, so is there a way to easily reset all folder attributes to default Read-only? Also tried below
FOR /f %a IN ('DIR /A/D/B') DO ATTRIB +R "%a"
but it changes files attributes too (i dont want my entire files to be read only) and doesnt change for subfolders. i think i need a for loop script to check %%a is folder or file and also search for all subfolders. a few days ago i created a script for a task that can check if 1% is a folder or a file, I used this template:
if exist %1\ (echo %%1 is Folder) else if exist %1 (echo %%1 is File) else (exit)
idk if its good for my case or not, because i havent tested it much yet.
Update: as @Señor CMasMas said i was wrong. the Read-only is default attribute only for folders with custom icon. so i dont want to mess with all folder, just folders that contain desktop.ini.