I was wondering if someone might be able to help me convert this vbscript I wrote into kix. The vbscript conversion udf I found in the library didn't really seem to even do much to the script at all.

It's a pretty simple script designed to grab the computer and MAC address and write to a text file which would look something like this.

%ComputerName% = %MAC%

It also checks for duplication and writes to a seperate log file if there are duplicates. Any help would be greatly appreciated.

Code:
'GetNics.vbs
'Author: Travis
'Date: 6/29/2005


'Force Declaration of Variables
Option Explicit

'Declare Variables
Dim NIC1, Nic, objNet,objHost,fso,ts, modMAC, strMAC, strRead

'If something fails, move on
On Error Resume Next

'Get the Computer's network name
Set objNet=CreateObject("wscript.Network")
objHost=objNet.ComputerName

'Get a connection to the WMI NetAdapteConfig object
Const strQuery = "Select * From Win32_NetworkAdapterConfiguration where IPEnabled = True"
Set NIC1 = GetObject("winmgmts:").ExecQuery(strQuery)

'Set Variables and Constants
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Set fso = CreateObject("Scripting.FileSystemObject")

'Run next portion of code for each NIC queried from WMI
For Each Nic in NIC1

'Set MAC variable for each NIC and open text file for reading
strMAC = NIC.MACAddress
modMAC = mid(strMAC,1,2) + mid(strMAC,4,2) + mid(strMAC,7,2) +mid(strMAC,10,2) +mid(strMAC,13,2) + mid(strMAC,16,2)
Set ts = fso.OpenTextFile ("\\sutil\images$\rename\test.txt", ForReading, True)
strRead = ts.readall

'Check for duplicate entries in text file
'Write to conflicts.txt if conflicts found
'Otherwise write MAC = ComputerName to test.txt

If Instr(strRead,modMAC) = 0 THEN
Set ts = fso.OpenTextFile ("\\sutil\images$\rename\test.txt", ForAppending, True)
ts.WriteLine modMAC & " = " & objHost
ts.Close
ElseIf Instr(strRead,modMAC & " = " & objHost) = 1 THEN
ts.Close
Wscript.QUIT
Else
Set ts = fso.OpenTextFile ("\\sutil\images$\rename\conflicts.txt", ForReading, True)
strRead = ts.readall
If Instr(strRead,modMAC & " = " & objHost) = 1 THEN
ts.Close
Wscript.QUIT
Else
ts.Close
Set ts = fso.OpenTextFile ("\\sutil\images$\rename\conflicts.txt", ForAppending, True)
ts.WriteLine modMAC & " = " & objHost
ts.Close
End If
End If
Next