get list of folders from local drive using vbscript -


i want delete documents(.doc) files computer, know how list of sub folders folder, not how list of folders root directory(ex c:)

subfoldersinfolder = folder.subfolder 

gives subfolders of folder. supposedly want folders c:,

 set coldrives = objfso.drives  each objdrive in coldrives  objdrive.subfolder  //doesn't work  next 

for each objfolder in objfso.getfolder("c:\").subfolders     wscript.echo objfolder.path next  ' or...  each objfolder in objfso.getdrive("c:").rootfolder.subfolders     wscript.echo objfolder.path next 

edit: sundar nataraj Сундар has asked go more detail.

this basic for loop iterates subfolders collection. subfolders property available folder object. can folder object root in number of ways. here 2 examples:

  1. use getfolder() function retrieve root folder.
  2. use rootfolder property of drive object.

i've added wscript.echo statement in each example demonstrate use of objfolder variable.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -