I have a batch file to check software installed on multiple computers. I want the batch file to give the machine name and then under it give the software list.
The text file should output like so:
jamespc1
installed software
in the batch file I have
echo %%a > pcs.txt
psinfo \\%%a >> pcs.txt
But every time the batch file runs it outputs as it should except it keeps overwriting the previous lines.
It inserts jamespc1 then appends the psinfo output under jamespc1 as it should, except it keeps overwriting the lines for each machine it checks so i end up with information for only the last machine in the list.
How can i get the batch file to create new lines in the txt file for each pc?
>will overwrite.>>will append.Everytime you run this it will use the overwrite first, hence replacing the old file.
Just change
>to>>to always append and keep all of the data.