• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

.bat fille - can a find/replace via VBA code be done for a .bat file

Hi EE,
I have a .bat file that executes another pgm.
   This pgm allows to feed in parameters.

Let's say, the parameter is set to run for '2008'' and I want to open the .bat file to globally
replace for '2009', can this be done?

(I have used Word Automation to do mailing labels and mail merge, was wondering if I should
open the .bat file in Word, and do a search and replace in Word etc.)

tx, sandra

  • 2
1 Solution
Kyle AbrahamsSenior .Net DeveloperCommented:
yes it can:

show how to parse a file:

I would then re-write the file using a replace command.

rename somefile.txt to somefile - original.txt
open somefile - original.txt
write somefile.txt replacing 2008 with 2009.
next file.
Kyle AbrahamsSenior .Net DeveloperCommented:
mytfeinAuthor Commented:
Hi Ged,
Skimmed the links that you provided.
Liked the one from Excel. It's clearer.

Will experiment and if have further questions will post again, tx, s
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now