How to Robocopy a file to a variable folder name.
I am current trying to manage files in a jboss war file (deploy\tmp543236qcbin-exp.war\) folder that changes its name on every start. It is a cached set of files.
One task:
Manage an image. Want to replace image in cached folder. (deploy\tmp543236qcbin-exp.war\images)
Second task:
Replace an html file in the cache folder.
Did not see any parameters in robocopy to allow us to send file file to a wildcard folder.
Windows BatchScripting LanguagesMicrosoft Development
Last Comment
oBdA
8/22/2022 - Mon
Hamed Nasr
You may set a variable for any part of the command and expand as %variable% in the proper place of the command.
Example:
Robocopy.exe d:\ G:\f\ *.txt
Set sd=D
Set df = G:\f
Set files = *.txt
Robocopy.exe %sd%:\ %df%\ %files%
Don't forget usual options for purge and exclude ..
Example:
Robocopy.exe d:\ G:\f\ *.txt
Set sd=D
Set df = G:\f
Set files = *.txt
Robocopy.exe %sd%:\ %df%\ %files%
Don't forget usual options for purge and exclude ..