Hi,

Does anyone have a script that will search a drive (and all subfolders) and
output (to a text file) a list of all files that exceed a specified number
of characters, including their full path?

Thanks,

Curtis.

--
Please reply to news group only. Thank you.

Re: Script needed to search for long filenames by Walter

Walter
Thu Jun 08 12:42:48 CDT 2006

Are you referring to path length or file size?

"Curtis Fray" <xxx@xxx.com> wrote in message
news:%238DCI3wiGHA.3408@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> Does anyone have a script that will search a drive (and all subfolders)
> and output (to a text file) a list of all files that exceed a specified
> number of characters, including their full path?
>
> Thanks,
>
> Curtis.
>
> --
> Please reply to news group only. Thank you.
>



Re: Script needed to search for long filenames by \

\
Thu Jun 08 13:53:10 CDT 2006

> Does anyone have a script that will search a drive (and all subfolders) and
> output (to a text file) a list of all files that exceed a specified number
> of characters, including their full path?

No problemo:
'===============LongNames.vbs============
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFile=fso.CreateTextFile("d:\longnames.txt")
Set root=fso.getFolder("c:\")
maxLength=50

call folderlist(root)

sub folderlist(grp)
call filelist(grp)
for each fldr in grp.subFolders
set nf=fso.GetFolder(fldr.path)
call folderlist(nf)
set nf=nothing
next
end sub

sub filelist(grp)
for each file in grp.files
if len(file.path)>maxLength then oFile.writeLine file.path
next
end sub
'=======================================
--
Crash

"Nothing is particularly hard if you divide it into small jobs."
~ Henry Ford ~



Re: Script needed to search for long filenames by Curtis

Curtis
Tue Jun 13 02:59:19 CDT 2006

Hi!

Thanks a lot for the script. Very helpful!

Regards,

Curtis.

--

""Crash" Dummy" <dvader@deathstar.mil> wrote in message
news:%23tJ4KzyiGHA.5036@TK2MSFTNGP04.phx.gbl...
>> Does anyone have a script that will search a drive (and all subfolders)
>> and
>> output (to a text file) a list of all files that exceed a specified
>> number
>> of characters, including their full path?
>
> No problemo:
> '===============LongNames.vbs============
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set oFile=fso.CreateTextFile("d:\longnames.txt")
> Set root=fso.getFolder("c:\")
> maxLength=50
>
> call folderlist(root)
>
> sub folderlist(grp)
> call filelist(grp)
> for each fldr in grp.subFolders
> set nf=fso.GetFolder(fldr.path)
> call folderlist(nf)
> set nf=nothing
> next
> end sub
>
> sub filelist(grp)
> for each file in grp.files
> if len(file.path)>maxLength then oFile.writeLine file.path
> next
> end sub
> '=======================================
> --
> Crash
>
> "Nothing is particularly hard if you divide it into small jobs."
> ~ Henry Ford ~
>
>