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?

sort by: active | newest | oldest
thegeeke5 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! :)
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.
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. :)
I understand, I only answered because I'm bored out of my mind.
HaHa... I wish I had that problem! :) I'm sure the OP posted it and never looked back to see if anyone answered it... :(
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!