How do I append running result logs to text file in a batch
Posted on 2014-02-17
I use the batch below. with the command pspasswd I am changing the local administrator password of the several machines which listed in "MachineSource.txt".
To Access to the machine admin user is "authorized_user" and password is "authorized_user_pass".
I want to have Error log. But the end part of the command, you se >2 d:\Errorlog.txt" saving only the last transaction's log.
How do I append every transaction's or only error transactions's log that pspasswd command does.
The Batch is:
for /F "usebackq delims==" %%I in ("MachineSource.txt") do Call :begin %%I
pspasswd \\%srv% -u auhorized_user -p authorized_user_pass administrator abc123 2> "D:\ERRORLOG.TXT"