500Views6Replies
Is there a Batch file command to allow me to edit another batch file?
Hi, I am trying to create a bbatch program that moves files from a certain directory to another. The problem I have is that this directory will be different on every computer. Is there a way I can create another batch file where the user enters the directory of the files to be moved and insert this into the required place in my original file?
Comments
8 years ago
Also, dostips has a function to add a line of text to any line in any file. http://www.dostips.com/?t=Function.append
Hope that helps!
9 years ago
Set /p "com="
Echo %com% >>(your file here)
That will add the user input in the end of a .txt file, I think it will do the same with a .bat. If you need to add any more text before or after the input, add it before or after %com%.
Good luck! :)
Answer 8 years ago
That is a good answer, but there are many other ways to do it.
There's the EDIT command and COPY CON.
All of these work effectively.
Answer 8 years ago
Yep. I agree. I'm not really a programmer, I'm a hardware guy; but since no one else answered, I did the best I could. :)