Copy contents of file and append with remote machine name

Hello,

I need to copy the contents of a .txt file on multiple remote computers and append with the machine name it is copied from. I wrote this to copy the file (>>logfile.txt 2>%1 echo type \\computer12345 \c$\bgi\info.txt) which works fine, but I am unable to snag machine name as well. Any help would be greatly appreciated.
1 answer Last reply
More about copy contents file append remote machine name
  1. Quote:
    Hello,

    I need to copy the contents of a .txt file on multiple remote computers and append with the machine name it is copied from. I wrote this to copy the file (>>logfile.txt 2>%1 echo type \\computer12345 \c$\bgi\info.txt) which works fine, but I am unable to snag machine name as well. Any help would be greatly appreciated.


    In a batch file, %computername% will give you the name of the PC the batch file is run on.

    To get remote PC names you will probably need to use something more advanced like vbscript.
Ask a new question

Read More

Computers Windows XP