@echo off REM Alan Kaplan 6-8-06 REM Ver 1.1 Added DOB search rem alan at akaplan dot com echo FileAudit 1.1 echo Alan Kaplan echo. echo This batch file creates lists of common document files echo and checks those files for SSN-like strings and the echo string "DOB:". The results are written to a folder on your echo desktop named %COMPUTERNAME%_FileAudit echo. echo The FINDSTR program will hammer the CPU and hard drive. Do echo not try to use the computer while the audit runs. It will echo take a long time to run on systems with many document files. echo. echo Note that SSN like strings does not mean SSNs, there will be false echo positives. You may also see false positives for "DOB:" echo. echo Press CTRL-C to break, or pause cls set LOGFOLDER=%USERPROFILE%\DESKTOP\%COMPUTERNAME%_FileAudit if not exist "%LOGFOLDER%" md "%LOGFOLDER%" for %%d in (C,D,E,F,G) DO SET DRIVELETTER=%%d& goto checkdrive goto end :CheckDrive if not exist %DRIVELETTER%:\* goto exit Echo Working on Drive %DRIVELETTER% cd /D %DRIVELETTER%:\ rem add whatever extensions you want to the lists rem I checked the below to see if they found SSN strings for %%x in (TXT,CSV,DOC,XLS,PPT,MDB) do echo Writing list of %%x files&dir /s *.%%x > "%LOGFOLDER%\Drive_%DRIVELETTER%_%%x_Files.txt for %%x in (TXT,CSV,DOC,XLS,PPT,MDB) do ECHO Searching %%x files for SSN&findstr /n /s /r /m [0-9][0-9][0-9]\-[0-9][0-9]\-[0-9][0-9][0-9][0-9] *.%%x > "%LOGFOLDER%\Drive_%DRIVELETTER%_%%x_SSNLikeString.txt for %%x in (TXT,CSV,DOC,XLS,PPT,MDB) do ECHO Searching %%x files for DOB:&findstr /n /s /m /i /c:"DOB:" *.%%x > "%LOGFOLDER%\Drive_%DRIVELETTER%_%%x_With_DOB.txt :end echo Audit complete. set DRIVELETTER= :exit pause cd /d "%USERPROFILE%\DESKTOP\%COMPUTERNAME%_FileAudit start . exit