I am trying to robocopy some files and retain the folder structure to a specific location.
I have a text file that contains 1 row with the following
- C:\Program Files\Test Folder\Test.ppt
I save those results to a variable
$results = get-content -path C:\somefolder\source.log
$Robocopy = C:\windows\system32\robocopy.exe
$Destination = Z:\Documents\Backup\
I want to iterate through that list and use robocopy to copy the files to another location and retain the folder structure.
the issue is that I would love if the destination location can somehow strip the C:\ from the results and robycopy with folder structure after the C:\ so here is an example of how I would like the final folder to look like.
- Z:\Documents\backup\Program Files\Test Folder\Test.ppt