echo command in batch file misbehaving - TechRepublic
General discussion
November 25, 2002 at 09:49 PM
tech_know

echo command in batch file misbehaving

by tech_know . Updated 23 years, 7 months ago

I have a batch file that I need to run in Windows 2000 and Windows 98 machines. Part of the bach file (in theory) captures the machine name and writes it to a log file via an echo command. The problem is, on 98 machines, sometimes it logs the machine name and other times it logs the words “echo is off” instead. The same PC will log it different ways. I have found no pattern as to why it will record the machine name one time and the words “echo is off” other times. The batch file is below. I would appreciate any help…

NET CONFIG | FIND /I “Computer Name” > %temp%.\netconf$.bat
echo >> computer.bat r:\tammy\cae\winset COMPUTERNAME = %%2
call %temp%.\netconf$.bat
echo %computername% >> r:\tammy\cae\done\w98.txt
GOTO END

This discussion is locked

All Comments