title: Need batch file that will call the server name from text file
body: <p>I need batch file that will call the server name in the listed text file and run he command on the same.</p>
  
  <p>eg.</p>
  
  <p><strong>Script.bat</strong></p>
  
  <pre><code>xcopy c:\Tool\DiskCleanp.bat \\%ServerName%\C$\Tool\ /Z /Y &gt;&gt; C:\result.txt
  Psexec \\%ServerName% c:\tool\DiskCleanp.bat C:\result.txt
  </code></pre>
  
  <p><strong>Server.txt</strong></p>
  
  <pre><code>Server01
  Server02
  Server03
  Server04    
  </code></pre>
  
  <p>Or Is there is any tool that will created a automatic batch file as per the requirement.</p>
  
  <p>Thanks in advance ...Accept as Solution </p>