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
using the code above, I want to insert the folder i'm currently in in %%G into the filename that is put in to destination in the xcopy.
So it might be coming from: i:\w3svc98435783475\ex110430.log and i want it to end up as D:\ServerLogsAndBackups\IIS\w1\w3svc98435783475_ex110430.log
anyone got any ideas?
Could you use cd? When called without arguments it prints out the current path. Then some way to get just the folder from that.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.