Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I am writing a batch script. i need to perform below tasks
1. Opening a file. searching a specific string(more then one letter) and replacing it with another string(more then on letter)
I checked in this forum. The solution was mentioned that we should use FOR command of DOS. But i am not able to do it. Can anybody please provide me the exact syntax
1. Once step1 is compelted i want to execute a dos command through my batch script. How do i do it?thanks in advance

To replace strings while searching through a text can be performed by scripting, but that requires advanced techniques which seem to be far beyond your actual experience.
First of all specify your operating system *exactly* as Windows XP/2K/NT and Windows 9X/ME belong to absolutely different families of products despite their common commercial logo (Windows). By the way XP/2K/NT doesn't have DOS, only an emulator (NTVDM).
I can't believe you are running real plain DOS: as it is, forget to achieve your target by the poor capabilities of classic DOS scripting (FOR is NT batch statement).
So stated you can find a short tutorial about FOR typing at prompt FOR /?, but again FOR in NT systems is more powerfull than its counterpart in DOS.
Think about what I posted and take your decision about going onto that lane.
Don't blame me... I'm an old, boring guy.

To do it in DOS, you need a 3rd party utility like:
It works on text files up to about 30KB.
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |