Hello - looking for help to create a workflow that moves all files in folder backwards two folders. - see below for example. I do not want/need the last two folders in this path and want to move the files to the folder with the detail folder name. Any ideas?
For each file in folder with the source folder as input..inside that use move file activity with currentfile.fullname as input and destination as the location of 2 folder down
Cheers
Hi @audra.swope
you can consider following below approach:
- have a source folder path and target folder path(2 folders backward path)
- then use “get files” activity to get all files in source path
- use for loop to move those files(by using move file activity) to target folder
you can also refer below video on same:
Hope this helps.
You can use the Directory.GetParent expression to get the parent folder. So use it twice to get the parent of the parent.
Hello @audra.swope
Please try using vb code
sourceFolder = “C:\Main\Detail\Temp1\Temp2”
For Each file In Directory.GetFiles(sourceFolder)
grandParent = Directory.GetParent(Directory.GetParent(sourceFolder).FullName).FullName
destPath = Path.Combine(grandParent, Path.GetFileName(file))
File.Move(file, destPath)
End For Each
Use an Invoke Code activity

