Discussion Locked
0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am using MRTG to log traffic on a switch. I would like to script the updating of the MRTG files. After the new *.cfg file is created I need to add three lines to the top of the file. This file can be manually updated using notepad, but I would like to make it part of the scripting. Any suggestion would be helpful
1 reply
by rawright
The old DOS COPY command should do the job. If the three lines you need to add are fixed, put them in a text file (lines.txt). In your script try the line:
copy lines.txt + xxxxx.cfg log.txt
This will append the contents of the xxxxx.cfg file to the contents of lines.txt and place it in log.txt. Then add:
del xxxxx.cfg
ren log.txt xxxxx.cfg
If this looks like it will address the problem, try it a few times from a command prompt before automating it with a script, just to be safe. The same process will work even if the three additional lines change, so long as there is some way you can get them into a file.
This discussion is closed to new replies.
Trending Windows Forum posts
Sort by Trending
0 helpful
15 replies
Question
Is WSL still relevant in 2026?
0 helpful
1 reply
0 helpful
2 replies
0 helpful
10 replies
Question Unanswered
i need help in transferring my bulk emlx files
0 helpful
0 replies