WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Files and Directories

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Recursive FileAttrSet

 Keywords: Recurse Files Recursive FileAttrSet File Attribute FileAttrSetRecurse UDF udfFileAttrSetRecurse Attrib + R A S H Read-only Hidden System Archive

#DefineFunction FileAttrSetRecurse(tree,dir,mask,attribute)
   ;The attribute string consists of one or more of the following characters (an upper case letter turns the specified attribute ON, a lower case letter turns it OFF):
   ;
   ; R read only ON
   ; A archive ON
   ; S system ON
   ; H hidden ON
   ;
   ; r read only OFF
   ; a archive OFF
   ; s system OFF
   ; h hidden OFF

   DirChange(dir)
   dlist = ItemSort(DirItemize("*.*"),@TAB)
   dcount = ItemCount(dlist,@TAB)

   For xx=1 To dcount
      thisdir = ItemExtract(xx,dlist,@TAB)
      tree = FileAttrSetRecurse(tree,thisdir,mask,settings)
   Next

   If tree=="" Then tt=""
   Else tt=@TAB



   FileAttrSet( mask, settings )
   DirChange("..")
   Return(1)
#EndFunction

startdir="C:\Temp\Attrs\"
mask="*.*"
settings = 'RASH'
mytree = FileAttrSetRecurse("",startdir,mask,attribute)

Exit

Article ID:   W18366
Filename:   Recursive FileAttrSet .txt
File Created: 2013:09:30:14:20:32
Last Updated: 2013:09:30:14:20:32