用vbscript将windowsdhcp文本转化为linuxdhcp方式

阅读更多


Dim fso, MyFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile("testfile.txt", True)
Set MyFile1= fso.OpenTextFile("22.txt", 1,0)

do while not(MyFile1.AtEndOfStream)
tempStr = MyFile1.ReadLine

a=Split(tempstr," ", -1,1)

MyFile.WriteLine("host " + a(2)+ "{")
MyFile.WriteLine("hardware ethernet " + a(0))
MyFile.WriteLine("fixed-address " + Left(a(1),2)+":" + Mid(a(1),3,2)+":"+ Mid(a(1),5,2)+":" + Mid(a(1),7,2)+":" + Mid(a(1),9,2) +":" + Mid(a(1),11,2))


MyFile.WriteLine("}")
  

loop

 
msgbox("good")
MyFile.Close
MyFile1.close

你可能感兴趣的:(VBScript)