Dan Thomson at myITforum.com

Pacifying the call of an undying passion

Syndication

News


    If they don't find you handsome, maybe they'll find you handy (Red Green).
    Proud member of the myITforum Network

Links: Helpful forums

Links: Interesting blogs

Links: User Groups

Stuff I do

April 2005 - Posts

What did your wife bring home from the store today?

My wife returns from a day of shopping and enters the house saying “Look what I got”. My wife can come home with some interesting stuff and this announcement usually makes me cringe. I turn around to see my wife on one end of a dog leash and on the other is a 70 ish pound Labradoodle. This is a mix between, yup, you guessed right, a Labrador and a Poodle. It pretty much looks like a thinner Lab with longer legs. The best part of this breed is that it has hair like a Poodle -vs- the fur of a Lab. Yeah, no shedding fur to constantly vacuum up.

He is approximately a year old and is named Max. He must have a pretty good temperament because he's been around for half the day now and I have yet to hear hardy a murmur out of him. I guess he's going to be a keeper. However, my wife must have temporarily lost her mind because we are about to move into a very tiny apartment for 9 months while we wait for our new house to be built. Needless to say, we'll be in some pretty cramped quarters for a while...

Posted Thursday, April 28, 2005 12:19 AM by dthomson | with no comments

Filed under:

Are you using the "Do It Yourself Script Center"

If so, here is some modified code to make the exported scripts a bit more user friendly.

I modified the code_maker.vbs file so that it produces a header at the top of the file for each item exported.

Here's the modified code_maker.vbs

Const adOpenStatic = 3
Const adLockOptimistic = 3

Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
Set fso = CreateObject("Scripting.FileSystemObject")

objConnection.Open _
    "Provider= Microsoft.Jet.OLEDB.4.0; " & _
        "Data Source=script_center_2.mdb"

objRecordSet.Open "SELECT * FROM Scripts WHERE ScriptLanguage = 'VBScript' ORDER BY Category1, Category2, Category3, Title", objConnection, adOpenStatic, adLockOptimistic

objRecordSet.MoveFirst

Do Until objRecordSet.EOF

    strPath = objRecordset.Fields.Item("LocalPath")
    strFileName = objRecordset.Fields.Item("Title")
    strFileName = "C:\Code" & strPath & strFileName & ".vbs"

    Set NewFile = fso.CreateTextFile(strFileName)
    NewFile.WriteLine CHR(39) & "This script is part of the TechNet Script Center's " & _
                      CHR(34) & "Do It Yourself" & CHR(34) & " script repository"
    NewFile.WriteLine CHR(39) & "and was exported on " & Now()
    NewFile.WriteLine ""

    NewFile.WriteLine CHR(39) & "Title:       " & objRecordset.Fields.Item("Title")
    NewFile.WriteLine CHR(39) & "Description: " & objRecordset.Fields.Item("Description")
    NewFile.WriteLine ""
    strCategory1 = objRecordset.Fields.Item("Category1")
    strCategory2 = objRecordset.Fields.Item("Category2")
    strCategory3 = objRecordset.Fields.Item("Category3")
    If Not IsNull(strCategory1) Then NewFile.Write CHR(39) & "Categories:  " & strCategory1
    If Not IsNull(strCategory2) Then NewFile.Write " \ " & strCategory2
    If Not IsNull(strCategory3) Then NewFile.Write " \ " & strCategory3

    NewFile.WriteLine ""
    NewFile.WriteLine ""
    NewFile.WriteLine CHR(39) & "Supported platforms"
    NewFile.WriteLine CHR(39) & vbTab & "Win 2003: " & objRecordset.Fields.Item("Win2003")
    NewFile.WriteLine CHR(39) & vbTab & "Win XP:   " & objRecordset.Fields.Item("WinXP")
    NewFile.WriteLine CHR(39) & vbTab & "Win 2000: " & objRecordset.Fields.Item("Win2000")
    NewFile.WriteLine CHR(39) & vbTab & "Win NT:   " & objRecordset.Fields.Item("WinNT")
    NewFile.WriteLine CHR(39) & vbTab & "Win 98:   " & objRecordset.Fields.Item("Win98")

    NewFile.WriteLine ""
    NewFile.WriteLine CHR(39) & "Script Code"
    NewFile.WriteLine CHR(39) & "************************************************************"
    NewFile.WriteLine ""
    strText = objRecordset.Fields.Item("ScriptCode") 
    NewFile.WriteLine strText
    NewFile.Close

    objRecordset.MoveNext
Loop

objRecordset.Close

Here's a sample exported script

'This script is part of the TechNet Script Center's "Do It Yourself" script repository
'and was exported on 4/13/2005 1:07:44 PM

'Title:       Copy an Active Directory Computer Account
'Description: Retrieves the attributes of an existing computer object and copies the attributes to a new computer object created by the script.

'Categories:  Active Directory \ Computer Accounts

'Supported platforms
' Win 2003: Yes
' Win XP:   Yes
' Win 2000: Yes
' Win NT:   Yes
' Win 98:   Yes

'Script Code
'************************************************************

Set objCompt = _
    GetObject("
LDAP://cn=Computers,dc=NA,dc=fabrikam,dc=com")
Set objComptCopy = objCompt.Create("computer", "cn=SEA-SQL-01")
objComptCopy.Put "sAMAccountName", "sea-sql-01"
objComptCopy.SetInfo
 
Set objComptTemplate = GetObject _
    ("
LDAP://cn=SEA-PM-01,cn=Computers,dc=NA,dc=fabrikam,dc=com")
arrAttributes = Array("description", "location")
 
For Each strAttrib in arrAttributes
    strValue = objComptTemplate.Get(strAttrib)
    objComptCopy.Put strAttrib, strValue
Next
 
objComptCopy.SetInfo

Don't forget to create a directory named C:\Code and then run the code_folder_maker.vbs script before running this script.

The Do It Yourself Script Center can be downloaded from TechNet's Script Center.

Posted Wednesday, April 13, 2005 2:23 PM by dthomson | 3 comment(s)

Filed under:

Call me crazy

After doing our taxes this year, my wife suggested I go ahead and replace my aging MagnaScan 20 CRT. I've been eyeing up a few LCD panels for a while now and didn't hessitate. I really like some of the dual screen setups, but didn't think I could justify the expense. Call me crazy if you want, but I've settled on a Dell branded wide screen LCD model #2405FPW. I can't wait for this thing to arrive.

I'll post a follow up with my thoughts on the LCD's design, features and function in a few weeks.

Posted Thursday, April 07, 2005 2:51 PM by dthomson | with no comments

Filed under: