First time using vbscript, how to access subfolders as well?

Viewed 19
 Set objFso = CreateObject("Scripting.FileSystemObject")
Set Folder = objFSO.GetFolder("C:\files")

For Each File In Folder.Files
    sNewFile = File.Name
    sNewFile = Replace(sNewFile,"-","_")
    if (sNewFile<>File.Name) then 
        File.Move(File.ParentFolder+"\"+sNewFile)
    end if

Next

im using this script and it works exactly as i want beside i need to specify the subfolder and doing it one by one will take forever in my case as i have like 100 folders to change the files inside, is there a way to access all the subfolders in the folder and their files in exactly same way it working right now? thanks!

0 Answers
Related