1.

Solve : Find a string in a running batch file and replace it.?

Answer»

I used the search, and everything I found didn't HELP much. So, how would you find a string in a batch file, and using the same batch file replace that string.You want a batch file to alter itself?
That is what it sound slike to me.
Wild guess. Maybe what he really wants is a replacement at run time. It will get a new string to tack onto each file in a group.Neither of you are correct, so I'll explain this again. My batch file has a lot of MSG * popups. So I want to give them the option of replacing the the msg* popups. So, I want to find and replace the msg * popups, so in a way I NEED the batch file to alter itself, but not literally. So, I need a code that will find and replace a string of code.You do know that it won't be REAL TIME...You might be able to change the string, then call itself?...I might just be dreaming...OH BOY Recursion in a batch file. Who needs java! We can now do it in a batch file. Maybe the towers of HANOI in a batch file. WAIT, I think somebody already did that!Quote from: Dias de verano on January 11, 2009, 03:27:44 PM

You want a batch file to alter itself?


Quote from: BatchFileCommand on January 11, 2009, 06:52:52 PM
Neither of you are correct ... so in a way I need the batch file to alter itself, but not literally.

now you're contradicting yourself. You want to "alter" the batch file, but not "literally" how? spiritually?

how about instead, you test within the batch file wether to show the popups, rather then trying to dynamically modify running code.I just thought up a way. When I'm done with the batch file I will just copy the whole thing (in the same batch file) and the copied section will have the messages disabled. The quick and dirty way.... hehe.

Quote
Maybe the towers of Hanoi in a batch file. Roll Eyes Wait, I think somebody already did that!

Yeah, someone did do it. 1mb .



Discussion

No Comment Found