On Error Resume Next Set Arg=Wscript.Arguments If Arg.Count=0 Then wscript.quit 'code by NetPatch 'enjoy it Set Fso=CreateObject("Scripting.FileSystemObject") Set File=Fso.OpenTextFile(arg(0),1,False,-2) Set Files=Fso.OpenTextFile(arg(0)".vbs",2,True) Do While File.AtEndOfStream > True szBuf=File.readline szBuf=Replace(szBuf,chr(9),"") Findnum=InStr(LCase(szBuf),"then") If Findnum >0 Then Findnum=findnum+3 If Len(szBuf) > Findnum Then szBuf=szBuf":End If" End If End If Files.Write szBuf":" Loop File.Close Files.Close Set Fso=Nothing Wscript.echo "ok!"