|
Answer» How to use one echo command to OUTPUT multi-lines
In the following example, i use echo command to create a reg.reg file. In this process, i must call echo command and open/close the c:\reg.reg file continuously, i think it is inefficient (because i will create MANY *.reg files), I hope i can implement it using one echo command, open/close the file one time. how can i do ?
Thands
Example:
echo off echo REGEDIT4 >> c:\reg.reg echo. >> c:\reg.reg echo [HKEY_CURRENT_USER\Control Panel\Mouse] >> c:\reg.reg echo "SwapMouseButtons"="1" >> c:\reg.reg echo "MouseSpeed"="3" >> c:\reg.reg echo "DoubleClickSpeed"="100" >> c:\reg.reg echo. >> c:\reg.reg Your file is fine as WRITTEN. There is not really a lot you can do with an echo statement. I would change echo REGEDIT4 >> c:\reg.reg to use a single > That way if you rerun the file, reg.reg will get created from scratch.
That said, updating the registry is risky, especially using a file. All the settings in your file can be set using the mouse applet in the control panel.
Hope this helps.
PS. Must be me, but your code snippet is very similar to something that came in yesterday. If you want to get some more info go to: http://www.all-nettools.com/forum/printthread.php?s=ad3241390513f2f6d7bee4b7b6fba0f6&t=1342&page=1&pp=15
And scroll down a little!!Sidewinder, constable-G Thank you for your replying. Yes, the example code is part of previous example, i do not care what the example code do, i just use the example to show what i wanted. In fact, i am writting the makefile for a project (it include many subproject and more than 500 files, and cannot use the IDE enviroment, visual studio). The top makefile will use batch file to CREAT submakefile for every subproject, it can WORK now, but i am not pleased with the speed, I think the echo operation is one of bottleneck, there are too many open/close operation, so i hope echo can output multi-line.
ThanksThank you very much, It is ok now.
|