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

How To
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

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

How to Make Directory Listings

Keywords: 	  Make Directory Listings  dirlist dir

Method 1:
AddExtender("wsrch34i.dll")

fh=FileOpen("dirlist.txt","WRITE")
BoxOpen("Dir List maker","")

handle=srchInit("C:\","w93gp17s.w8f","","",16+32)    ; search for non0existant file name
while 1
   retval=srchNext(handle)
   if retval=="" then break
   if strsub(retval,strlen(retval),1)!="\" then continue
   FileWrite(fh,retval)
   BoxText(retval)
endwhile
srchFree(handle)
FileClose(fh)
Message("All","Doned")
exit

Method 2:
#DefineFunction UDFListDirs(handle,dir)
   ;uncomment to include hidden dirs
   ;IntControl(5,1,0,0,0)
   ;change to target directory
   DirChange(dir)
   topdir=DirGet()
   BoxText(topdir)
   FileWrite(handle,topdir)
   ;Get list of subdirectories
   dirlist=DirItemize("*.*")
   ;Process list
   dircount=ItemCount(dirlist,@tab)
   for xx=1 to dircount
      thisdir=ItemExtract(xx,dirlist,@tab)
      UDFListDirs(handle,thisdir)
   next
   ;bump up one directory level
   DirChange("..")
   return
#EndFunction


BoxOpen("Dir List Maker","")
handle=FileOpen("dirlist.txt","WRITE")
UDFListDirs(handle, "c:\bizdocs\incoming")
FileCLose(handle)
Message("","lisrdir complete")

Article ID:   W15519
File Created: 2003:05:13:11:28:28
Last Updated: 2003:05:13:11:28:28