windows - Need batch file that will call the server name from text file -


I want a batch file that will call the server name in the text file listed and execute the command at the same time.

E.g.

Script.bat

  xcopy c: \ Tool \ DiskCleanp.bat \\ ServerName% \ C $ \ tool \ / z / Y & gt; & Gt; C: \ result.txt Pexec \\% server name% c: \ tool \ DiskCleanp.bat C: \ result.txt  

Server.txt

  server01 server02 server03 server04  

Or is there a device that will create an automatic batch file as per the requirement.

Thanks in advance ... Accept as a solution

Use the / F option to use Help for more information

Something like this (unchecked!):

 for  /f %% i (server.txt ) Do (xcopy c: \ Tool \ DiskCleanp.bat \\%% I \ C $ \ Tool \ / Z / Y & gt; C: \ result.txt Psexec \\ %% IC: \ Tool \ DiskCleanp .bat C: \ result.txt)  

Note that the bracket around the file name and the bracket around the block of the command round bracket / The Rtk.


Comments