Click here for important information about

Progamming: Batch File find and replace in te

Microsoft Windows xp professional w/serv...
June 30, 2010 at 14:47:28
Specs: Windows XP
HI I have a script file that looks like this:

OpenSession ("c:\program files\NMT\cdcmvs01.nmt")
WaitFor (UNLOCK)
FunctionKey (ENTER)
WaitFor (UNLOCK)
WaitForCursorPos (6, 31)
FunctionKey (PF3)
WaitFor (UNLOCK)
WaitForCursorPos (3, 17)
TypeString ("jd606")
FunctionKey (TAB)
TypeString ("Lta325sd")
FunctionKey (ENTER)
WaitFor (UNLOCK)
WaitForCursorPos (17, 26)
FunctionKey (ENTER)
WaitFor (UNLOCK)
WaitForCursorPos (12, 42)
StartScript ("")

What a would like to be able to do is write a batch file that depending on a menu choice edits the line StartScript ("") and save the file before invoking the script.

I know how to handle the menu code but have been unable to find a way to open the file parse and change the line indicated. Basically a find and replace operation.

Can anyone help


See More: Progamming: Batch File find and replace in te

June 30, 2010 at 21:04:36
(echo 1,*rStartScript ^(""^)^ZStartscript^(xx^)
echo w) | edlin script
::-------- end snippet
where ^Z is literally control-z (=asc.26 = 1A)
edlin avoids some of the problems with possiblility
of "special" characters in batch.
vbscript is another excellent alternative using readall and replace. call back if interested in that route.

Report •
Related Solutions

Ask Question