Friday, September 25, 2009

How to Map a Tree Structure

To answer the question I had on how I could map my directory tree structure so I could easily see layout all at once, I turned to an example I found in the book “Windows Server Hacks” by Mitch Tulloch, copyright 2004 O’Reilly & Associates, Inc., ISBN 0-596-00647-0.

Seen below is the snipet of VB code. Simply open Notepad with WordWrap turned off, and paste it in. Save the file as “vbtree.vbs” to whatever point in the directory you wish your mapping to start.

I have slightly modified the introductory comments for clarity.

—————————————————————————————————

‘This script is used to show a simple directory tree
‘In command prompt, navigate to directory folder where this file is stored
‘Type cscript vbtree.vbs to display the tree
‘Type cscript vbtree.vbs > tree.txt to redirect the output to a text file
‘Source: Windows Server Hacks

Option Explicit
Dim sArg, oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")

‘Get folder (default is current directory)
If Wscript.Arguments.Count > 0 Then
sArg = Wscript.Arguments(0)
Else
sArg = “.”
End If
sArg = oFSO.GetAbsolutePathName(sArg)

‘Process entire tree (if valid folder)
If oFSO.FolderExists(sArg) Then
Wscript.Echo “Folder tree for: “, sArg
ShowTree “", oFSO.GetFolder(sArg)
End If

Set oFSO = Nothing
Wscript.Quit(0)

Sub ShowTree(sIndent, oFolder)
Dim oSubFolder, ix
ix = 1
For Each oSubFolder In oFolder.SubFolders
Wscript.Echo sIndent & “+–” & oSubFolder.Name
If ix <> oFolder.SubFolders.Count Then
ShowTree sIndent & “| “, oSubFolder
Else
ShowTree sIndent & ” “, oSubFolder
End If
ix = ix + 1
Next
End Sub

Friday, April 24, 2009

Regedit vs Regedt32

Here is a decent article from Microsoft explaining "The Differences between Regedit.exe and Regedt32.exe": http://support.microsoft.com/kb/141377 .

I would highlight that when using Windows 2000 Server, you want to use Regedt32.
While the String Editor (associated with file type REG_SZ) appears to operate the same using either executable, the Multi-String Editor (associated with file type REG_MULTI_SZ) functions properly only if Regedt32 is used.

The Microsoft article warns that "If you try to edit either of these data types (REG_MULTI_SZ or REG_EXPAND_SZ), Regedit.exe saves it as REG_SZ, and the data type no longer performs its intended function."

Thursday, April 23, 2009

Forward Confirmed reverse DNS

I read this article on wikipedia: http://en.wikipedia.org/wiki/Forward_Confirmed_reverse_DNS.

There, I found this tool:
http://ipadmin.junkemailfilter.com/rdns.php.

In my email account, I then select a message and right-click and choose "View message source."
About the fifth line down, I see the IP address that the message was received from.
I can then plug that IP into the tool above and validate it.