Here is what I created in power shell script.
Ping back if you don't follow it.
foreach ($i in Get-ChildItem -recurse C:\temp\xcopy\ -exclude "*_done","*_exception" | where{$_.PsIsContainer})
{
Move-Item $i\* C:\Temp\xcopy -force
Remove-Item $i.FullName
}
Here is what it does,
1. Loops thru and gets all the folders in the c:\temp\xopy folder.
a. 'exception' does not bring back any folder with name ending with '_done' or '_exception'
2. moves all the files in that folder to any other folder.
3. Deletes the folder after it moves it.
No comments:
Post a Comment