Sign in with
Sign up | Sign in
Your question

Copy contents of file and append with remote machine name

Last response: in Windows XP
Share
Anonymous
July 13, 2010 12:43:12 PM

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.
July 13, 2010 4:48:16 PM

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.
m
0
l
!