Some more powershell:

"Timestamp " + (get-date).ToString()
"This job started at " + (get-date).ToString() | out-file
message-longpaths.txt
"Long directory and file names - 250 characters or more`n`n`n" | out-file
-append message-longpaths.txt
Erase longpaths-home.txt
Get-childitem -recurse j:,k:,l: |? {$_.FullName.Length -gt 250} | out-file
-append longpaths-home.txt

Etc.

Regards,

Michael B. Smith, MCITP:SA,EMA/MCSE/Exchange MVP
My blog: http://TheEssentialExchange.com/blogs/michael
Link with me at: http://www.linkedin.com/in/theessentialexchange


-----Original Message-----
From: Kurt Buff [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 01, 2008 12:22 PM
To: NT System Admin Issues
Subject: Re: Windirstat

Kevin,

FWIW, here are the scripts that I use to find long file/path
specifications - I use 'dir /b /s' to generate a file listing, then
use vbscript to massage the output to find files longer than 250
characters, and mail it to myself. A little bit of vbscripting should
make this work to your purposes.

----------Begin CMD script, which calls a VBScript----------
@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
del c:\BatchFiles\logs\BigLines250.txt
Echo Long directory and file names - 250 characters or more >>
c:\BatchFiles\logs\message-longpaths.txt
Echo "" >> c:\BatchFiles\logs\message-longpaths.txt
Echo "" >> c:\BatchFiles\logs\message-longpaths.txt
Echo "" >> c:\BatchFiles\logs\message-longpaths.txt
dir j:\ /b /s > c:\BatchFiles\logs\LongPaths-Home.txt
dir k:\ /b /s >> c:\BatchFiles\logs\LongPaths-Home.txt
dir l:\ /b /s >> c:\BatchFiles\logs\LongPaths-Home.txt
REM
REM I touch the file to create it - it's easier than using VBScript to
create it.
REM These utilities can be found at http://gnuwin32.sf.net
REM
c:\BatchFiles\tools\touch c:\BatchFiles\logs\BigLines250.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 Date is %_DateEnd% and Time is %_TimeEnd%
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
file server"  -to [EMAIL PROTECTED] -server exchange.mycompany.com -f
[EMAIL PROTECTED]
----------End CMD script, which calls a VBScript----------


----------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----------



On Wed, Oct 1, 2008 at 5:58 AM, Kevin Lundy <[EMAIL PROTECTED]> wrote:
> Thanks for diruse.  Useful for something else!  However my current task is
> trying to analyze about 8T of files for data types in preparation of
> installing an enterprise search.  So I'm interested in the right side of
> windirstat - utilization per file type.  From my quick review of diruse I
> don't think I see that.
>
> Looks like I will just be manually transposing data from windirstat into
> excel.  Although I'm experimenting with sizemenow and it may do it.

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~


~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to