This is kinda clumsy, but it does the job for me. It's a cmd file that
calls a vbscript. Pretty brute force.
This cmd script:
----------Begin Batch File----------
@echo off
REM
REM Get the time and date
REM
for /F %%i in ('date /t') do ( set _DateStart=%%i)
for /F %%i in ('time /t') do ( set _TimeStart=%%i)
echo Date is %_DateStart% and Time is %_TimeStart%
REM
REM Begin the text of the email to be sent
REM
echo This job started at %_TimeStart% on %_DateStart% >
c:\BatchFiles\logs\message-longpaths.txt
echo > c:\BatchFiles\logs\BigLines250.txt
Echo Long directory and file names - 250 characters or more >>
c:\BatchFiles\logs\message-longpaths.txt
dir k:\ /b /s > c:\BatchFiles\logs\LongPaths-Home.txt
cscript c:\BatchFiles\BigLines250.vbs
for /F %%i in ('date /t') do ( set _DateEnd=%%i)
for /F %%i in ('time /t') do ( set _TimeEnd=%%i)
echo This job ended at %_TimeEnd% on %_DateEnd% >>
c:\BatchFiles\logs\message-longpaths.txt
c:\BatchFiles\tools\blat c:\BatchFiles\logs\message-longpaths.txt
-attacht c:\BatchFiles\logs\biglines250.txt -subject "Long names on
fs1" -to [EMAIL PROTECTED] -server exchange.mycompany.com -f
[EMAIL PROTECTED]
----------End Batch File
Calls the following vbscript file:
----------Begin VBSCript----------
rem
http://www.microsoft.com/technet/scriptcenter/resources/qanda/jan06/hey0103.mspx
Const ForReading = 1
Const ForWriting = 2
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\batchfiles\logs\LongPaths-Home.txt",
ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.Readline
If Len(strLine) > 250 Then
strNewContents = strNewContents & strLine & vbCrLf
End If
Loop
objFile.Close
Set objFile = objFSO.OpenTextFile("C:\BatchFiles\logs\BigLines250.txt",
ForWriting)
objFile.Write strNewContents
objFile.Close
----------End VBScript File----------
On 5/2/08, Kevin Lundy <[EMAIL PROTECTED]> wrote:
> We are having a problem with one of our archive tools (Disk Extender).
> Better said, Disk Extender has identified a problem where some directory and
> file paths are >256 characters. I thought that was a hard limit in Windows
> so not sure how they got created.
>
> Does anyone know of a tool, or way to script, that will give us a report of
> at least directories that exceed some limit? We have about 4 TB of
> unstructured files, so we don't want to see every file that exceeds the
> length, but a list of every directory path over say 240 characters would be
> a good start.
>
> I thought the good old dir command used to have a switch to only display
> directories and not files but don't see it anymore. I was just going to
> pipe dir commands to files and then import and sort.
>
> Kevin
>
>
>
>
>
>
>
>
>
~ Upgrade to Next Generation Antispam/Antivirus with Ninja! ~
~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm> ~