batch file to copy files from one server to other adding remote directory to filename in process
问题 I've written a batch file to copy files from one server to another, however, i need to be able to rename the file just copied to contain the folder path. The code i have come up with to do the job is: ECHO OFF SETLOCAL EnableDelayedExpansion set include=*.log FOR /L %%i IN (1,2,3) DO ( net use i: \\my-server%%i\d$\IISLogs FOR /R i:\ %%G IN (%include%) DO ( XCOPY %%G D:\ServerLogsAndBackups\IIS\w%%i\ ) 7z a -t7z D:\ServerLogsAndBackups\IIS\w%%i\files%%i.7z *.log -mx9 net use i: /delete ) The