Click to See Complete Forum and Search --> : Notepad.exe command line in batch mode


oblonski
August 24th, 2005, 11:37 AM
Hi, can any one help me!
I'm trying to write a command line which launch notepad.exe, replace a string with another and write a new file in a batch (silent) mode. is that possible ?
For Unix users, the "sed" command can do this, is there any equivalent command (msdos) or a nother way to do so ?
Thanks !
Oblonski

Arjay
August 24th, 2005, 11:59 AM
It sounds like you need to modify a file? If so, why use notepad? Just open the file, search for the text you need to replace, replace the text, and save the file.

There really isn't any need to involve notepad (although you could use notepad, if you really needed to).

Another option (along the lines of using notepad) is to use WordPad. Why? Wordpad is a COM server. So you can programmatically manipulate it's functionality. You can open it, load a file, manipulate the file, and save it - all programmatically.

But again, unless you need some functionality specific to notepad (or wordpad), just modify the file directly.

Arjay