5/10/2005

VB Script wrapper function for regular expression.


Function Found(strTarget, strPattern)
Dim regEx
Set regEx = New RegExp
regEx.Pattern = strPattern
regEx.IgnoreCase = False
Found = regEx.Test(strTarget)
set regEx = Nothing
End Function

WMI script to find files last accessed on a certain date.


dtDate = "5/2/2005"
strSearchFolder = "C:\Windows"

Set objFSO = CreateObject("Scripting.FileSystemObject")
WScript.Echo "File(s) last accessed on: " & dtDate & " in: " & strSearchFolder
EnumAndCheckFiles objFSO.GetFolder(strSearchFolder), dtDate

Sub EnumAndCheckFiles(objFolder, dtDate)
Set objFiles = objFolder.Files
For Each objFile in objFiles
CheckFile objFile, dtDate
Next
For Each objSubfolder in objFolder.SubFolders
EnumAndCheckFiles objSubfolder, dtDate
Next
End Sub

Sub CheckFile(objFile, dtDate)
If DateDiff("d", objFile.DateLastAccessed, dtDate) = 0 Then
WScript.Echo objFile.Path
End if
End Sub



5/02/2005

Mac OS 10.4 Tiger Stealth Mode

The new stealth mode in Tiger is just this ipfw command

ipfw -q add 20000 deny icmp from any to me in icmptypes 8