January 30, 200917 yr hello dear friends i need a simple batch command that makes the attributes of the folders inside a folder as system but i cant do it since the folder dont have an extension. it must be something like "attrib +s *.folder" i know its funny but this is all i can suggest can you help me please ?
January 30, 200917 yr The 'attrib' cmd command supports defining a folder-name as target, but then wildcards isn't supported.Also, there's switches for enabling recursiveness(/s) and for enabling the processing of folders additionally(/d).
January 30, 200917 yr Well, i've created such a batch as below a long time ago and i've been using this since then. (I believe i've edited some else package to be like this. Which? I don't recall)I've removed some entries in order to make it a demo. I use this to remove read only attribute from folders i want. You can basically change the -R key to +S and edit the necessarry sections as you wish.cWnd /HIDE @cls@echo offgoto top Attrib1.bat Program Files'da bulunan dosyalardaki "Salt Okunur" özelliğini kaldırır.Nomadturk:topset name=topif not %1()==() goto partialattrib -R "%systemdrive%\program files\AIMP2\*.*" /S /Dgoto top12:top12set name=top12if not %1()==() goto partialattrib -R "%systemdrive%\program files\Winrar\*.*" /S /Dgoto top14:top14set name=top14if not %1()==() goto partialattrib -R "%systemdrive%\install\*.*" /S /Dgoto end:partialset name=partialattrib -R %1 /S /Dif %2()==() goto endswitch:endset name=endexitThis one, is recursive.
January 30, 200917 yr you can use the /d switchattrib /d /s +s c:\foldername\*.*this will make all folders and files under c:\foldername +syou can follow up with a attrib -s c:\foldername\*.* /sthis will remove s on only the files inside itdunno if this was helpful at all since you probably dont want to mess with the files
January 30, 200917 yr Well, mine is recursive. That's why it's many more lines. But i remember /d not working for me.(:Darksimoon, if all you need is to change the attributes of some known files, than you'ld better use just this code:attrib +s X:\Path\filename1.extattrib +s X:\Path\filename2.ext...attrib +s X:\Path\filenameX.extIf not, give the others a try. Edited January 30, 200917 yr by nomadturk
January 30, 200917 yr Author hello friends ;thank you very much for your replies. @ nomadturk i wanted to try your codes however it seemed to me a little complicated. yet thank you very much for your reply. @KingAFW your solution worked for me and it's easy. thank you very much. Here are the lines i used;attrib +s "D:\userxpsettings\Desktop\New Folder\*.* " /S /Dattrib -s "D:\userxpsettings\Desktop\New Folder\*.* " /S1st line attributes all the FILES and FOLDERS +S and the 2nd line removes S attribute from FILES and the result is only the folders are +S attributed.
January 31, 200917 yr Glad to be of help Gonna be a problem if you have system files in there though Dunno how to get around that.
Create an account or sign in to comment