Keep some part of file and process others by a vbs from bat

June 10, 2013 at 22:45:40
Specs: Windows 7
I need to keep some part of a file and deal with those items whom I pull from this file. I call a vbs script file from a batch to process those items I want to transform. My goal is to have all of them (items which are transformed by the vbs process and those which are not concerned by this process) into the same file.

batch file
@echo off
cscript run.vbs findstr /r "^I.=" "%~f1"

set objF=createobject("scripting.filesystemobject")

Every time that I run batch, it occurs an execution error in my vbs script at the line x=objF.opentextfile(wscript.arguments(0),1).readall. I understand this error because the parameter given at run.vbs from batch is not a file.

I am searching a trick to implement my need. please could you suggest me anything? Thank you in advance

See More: Keep some part of file and process others by a vbs from bat

Report •

June 11, 2013 at 13:23:30
'==== begin vbscript
set regex=new regexp
set fso=createobject("scripting.filesystemobject")
fso.opentextfile("test_out",2,true).write regex.replace(x,b)

Report •
Related Solutions

Ask Question