| |
MAK
Posts: 5
Score: 0
Joined: 7/15/2005
Status: offline
|
vbscript Set objArgs = WScript.Arguments inputfile=objArgs(0) Set iFSO = CreateObject("Scripting.FilesyStemObject") Set oFSO = CreateObject("Scripting.FilesyStemObject") Set ifile = iFSO.OpenTextFile(inputfile) text2="" Do until ifile.AtEndOfLine text1= ifile.ReadLine if left(text1,23)="registeredorganisation=" then a=replace(text1,"registeredorganisation=","") end if if left(text1,16)="registeredowner=" then b=replace(text1,"registeredowner=","") end if if left(text1,18)="defaultdomainname=" then c=replace(text1,"defaultdomainname=","") end if if left(text1,16)="defaultusername=" then d=replace(text1,"defaultusername=","") end if loop wscript.echo a & "," & b & "," & c & "," & d Usage: cscript/nologo readfile.vbs a.txt result: Company Name ,POS Till ,Location-BS ,user You can call this script many times for every files using a FOR loop in a batch file. or use vbscript to loop through all the files in the folder.
|
|