move the file name into excel

February 17, 2010 at 03:54:49
Specs: Windows XP

I have thousand five hundred folder,how to move the folder name into excel

See More: move the file name into excel

Report •

February 17, 2010 at 03:57:40
please help me.......

Report •

February 17, 2010 at 08:51:32
how to move the folder name into excel

Copy & Paste ??

You'll have to be a bit more specific.


Report •

February 17, 2010 at 11:27:14

The way to do this is to use this windows script to create a text file of all folders and filenames.
Then import the file into Excel.

Change the destination path/filename for the output of the script as appropriate.

I cannot remember where the script came from - I did not write it, so my apologies for not crediting the author.

The script is a file named 'DirectoryListing.vbs'
Create it using notepad or similar
enter this:

Dim strPath
Set oFSO = CreateObject("Scripting.FileSystemObject")

strPath = InputBox("Enter Folder Path: ")

Set fOut = oFSO.CreateTextFile("c:\temp\Report_file.txt", True)
DoStuff oFSO.GetFolder(strPath).Path
Sub DoStuff(sDir)
fOut.WriteLine sDir
Set oDir = oFSO.GetFolder(sDir)
For Each i In oDir.Files
fOut.WriteLine i.Name
fOut.WriteLine ""
For Each i In oDir.SubFolders
DoStuff i.Path
End Sub

When you run this script it asks for a Folder Path, so enter a path to the root of the folders you wish to get the names from.

Once you have the names in Excel, if you only want folders, use Auto filter for cells containing '\'


Report •

Related Solutions

February 17, 2010 at 13:57:33
move the folder name

Do you mean File names or Directory names?
(Windows refers to Directories as Folders)

Are they all in one place or spread out in several locations?

Do they have a common extension?

A .BAT file can probably do what you need.


Report •

Ask Question