Reputation: 71
I am new with the batch file.
How can I append hostname in a text file
-Text file 1 -
Text Line 0
Text Line 1
Text Line 2
.
.
.
Expected result in Text File 2
Hostname + Text Line 0
Hostname + Text Line 1
Hostname + Text Line 2
.
.
.
Upvotes: 0
Views: 1258
Reputation: 15470
You can do this:
@echo off
echo %computername% + line 1 >>txtfilepath.txt
:: Continue like above, here %computername% is the host name
Upvotes: 1