vbscript find all subfolders with same name

April 24, 2009 at 19:00:05
Specs: WIndows
I'm trying to find a script to copy files to sub folders which have same names but their parent folders have different names. I searched around and I could not find anything that I could use.

Basically copy TEXT.TXT to all folders called data

Thanks in advance

See More: vbscript find all subfolders with same name

Report •

April 25, 2009 at 03:55:59
Set objFS = CreateObject("Scripting.FileSystemObject")
strFolder = "c:\startfolder"
Set objFolder = objFS.GetFolder(strFolder)
Sub ScanDir (objFolder)
	For Each strDir In objFolder.SubFolders
		WScript.Echo strDir.Name & "," & strDir.Path &","&strDir.Size
		If strDir.Name = "data" Then
			' copy file..
		End If 
End Sub
ScanDir objFolder

Unix Win32 tools | Gawk for Windows

Report •

April 28, 2009 at 14:35:56
I'm a noob how would you word copy path from the example above. 'copy file..

Report •

Related Solutions

Ask Question