I have this file generated by WMI output reading the network configuration
Description: :Intel(R) 82577LM Gigabit Network Connection #2:
Physical (MAC) address:
IP address: 1.x.x.x
Subnet: 255.255.255.0
Subnet: 64
Default gateway: 1.x.x.1
DNS
1.x.x.12
1.x.x.13
1..x.x.14
1.x.x.15
DNS domain: x.com
WINS
Primary WINS server: 1.x.x.50
Secondary WINS server: 1.x.x.53
what i am trying to attain is I need to read the file and then out put in a new file with each entry on a new line that i can feed into my WMI updates.
Description(actual value)
MAC Address(actual value)
IP address(actual Value)
Subnet "
Gateway "
i have taken general approach below which copies my whole file over.
Const ForReading = 1
Const ForWriting = 2
inFile = InputBox ("Enter File to read", "Source File")
outFile = InputBox ("Enter File to write:", "Destination File")
Set objFSO = CreateObject ("Scripting.FileSystemObject")
Set objRead = objFSO.OpenTextFile(inFile, ForReading)
Set objWrite = objFSO.CreateTextFile (outFile, ForWriting)
Do While Not objRead.AtEndOfStream
strLine = objRead.ReadLine
if strLine <> "" then
objWrite.WriteLine strLine
end if
Loop
objRead.Close
objWrite.Close
Set objRead = nothing
Set objWrite = nothing
Description: :Intel(R) 82577LM Gigabit Network Connection #2:
Physical (MAC) address:
IP address: 1.x.x.x
Subnet: 255.255.255.0
Subnet: 64
Default gateway: 1.x.x.1
DNS
1.x.x.12
1.x.x.13
1..x.x.14
1.x.x.15
DNS domain: x.com
WINS
Primary WINS server: 1.x.x.50
Secondary WINS server: 1.x.x.53
what i am trying to attain is I need to read the file and then out put in a new file with each entry on a new line that i can feed into my WMI updates.
Description(actual value)
MAC Address(actual value)
IP address(actual Value)
Subnet "
Gateway "
i have taken general approach below which copies my whole file over.
Const ForReading = 1
Const ForWriting = 2
inFile = InputBox ("Enter File to read", "Source File")
outFile = InputBox ("Enter File to write:", "Destination File")
Set objFSO = CreateObject ("Scripting.FileSystemObject")
Set objRead = objFSO.OpenTextFile(inFile, ForReading)
Set objWrite = objFSO.CreateTextFile (outFile, ForWriting)
Do While Not objRead.AtEndOfStream
strLine = objRead.ReadLine
if strLine <> "" then
objWrite.WriteLine strLine
end if
Loop
objRead.Close
objWrite.Close
Set objRead = nothing
Set objWrite = nothing