• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • 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



0
mytfein
Asked:
mytfein
  • 2
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
yes it can:
http://www.utteraccess.com/forums/printthread.php?Cat=&Board=83&main=1011627&type=thread

show how to parse a file:
http://www.pptfaq.com/FAQ00913.htm

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

eg:
rename somefile.txt to somefile - original.txt
open somefile - original.txt
write somefile.txt replacing 2008 with 2009.
next file.
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
0
 
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
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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