Operating environment: Win XP CMD (ver 5.1.2600). Due to work needs, I now need to read a local log file in a batch file and convert the log into a VBS display. (The content stored in the log is only a text file, and there are no VBS statements.)
So I must add "(MSGbox ") at the front of the log and (") at the back, then change it to a script with the.vbs suffix and execute it.
The problem is that there are some small problems when operating with the following code in the batch file:
After execution, there will be an extra carriage return after MSGbox " in the generated vbs file. You know that carriage returns are not allowed in.vbs. Please ask the experts in the forum for guidance.
I found that when using echo MSGbox ">1.txt, an extra blank line will be added at the end of 1.txt. I think the problem is here. Can I delete the carriage return in the echo input?
[ Last edited by voiL on 2005-12-5 at 09:48 ]
So I must add "(MSGbox ") at the front of the log and (") at the back, then change it to a script with the.vbs suffix and execute it.
The problem is that there are some small problems when operating with the following code in the batch file:
copy xxx.log 2.txt
echo MSGbox ">1.txt
echo ",64,"日志明细">3.txt
copy 1.txt+2.txt+3.txt 4.vbs
start 4.vbs
After execution, there will be an extra carriage return after MSGbox " in the generated vbs file. You know that carriage returns are not allowed in.vbs. Please ask the experts in the forum for guidance.
I found that when using echo MSGbox ">1.txt, an extra blank line will be added at the end of 1.txt. I think the problem is here. Can I delete the carriage return in the echo input?
[ Last edited by voiL on 2005-12-5 at 09:48 ]

