Robocopying multiple folders at one time - powershell

I have a folder per day in c:/place/, like C:/place/2017-01-01 & C:/place/2017-01-31
I want to use robocopy to move 2017-01-0* from c:/place to d:/place, what would be the proper syntax to move all of those folders at once?
I'm using PowerShell to accomplish the task, but I don't want to use a do/FOR as moving one folder at a time would take far too long.

$source = "c:/place"
$dest= "d:/place"
robocopy $source $dest /COPYALL /B /SEC /MIR

Related

Using Robocopy in Powershell

I am having a challenge while trying to move a large number of files from one location to another. I have a list of folders that I want to move in a .csv and I want to move those items to a new network location. When I use robocopy, only the content of the folders is moved, not the top level folder. This leads to unorganized files. I have tried using move-item but there is not a good logging feature that I can get to work. So here I am.
I am trying to use robocopy but I need to create a destination folder based on the last part of the source path for each item in a list. I have been working on this for hours, please help.
GC -Path C:\Test_1\Test_List.csv |
ForEach-Object
{
$Destination = new-item NAME BASED ON PART OF FILE -itemtype directory |
Robocopy $_ $Destination /e /move /LOG+:C:\Test_2\Test_Copy_Log.txt /NP
}

Move-Item from sub folder to second subfolder using variable destination

I'd like to move all the files in multiple folders into a subfolder within those folders.
So from C:\Desktop\Folder to C:\Desktop\Folder\cv.
I'm having difficulty targeting the correct destination, so far I've tried:
Get-ChildItem *cv -Recurse -Exclude "cv" | Move-Item -Destination {"C:\Desktop\$($_.Name)\cv"}
I'm using Windows PowerShell.
EDIT: For those interested I've found a way to do this using CMD:
FOR /D %G IN ("*cv") DO robocopy /move "%~G" "%~G\cv" "*"
I'd still like to know how to do this using PowerShell, though.

RoboCopy /minlad not working

Trying to use robocopy to move folders that haven’t been modified in 24 hours, with some exclusions. But when executed, all the folders bar the exclusions are moved, this means that folders that have been modified in the last 24 hours are moved as well,
I’ve tried also tried /minage to try and test if it was just me, but there was no difference.
I removed the full file paths as they included my full name
robocopy C:\File1 C:\2Delete *.* /E /XD C:\2Delete /move /MINLAD:1 /Xd "C:\Other" /Xd "C:\Public" /Xd "C:\Default" pause

Powershell/bat - copy folder to multiple destinations

I have folder c:\tocopy that I would like to copy the content to c:\dest1, c:\dest2 and overriding the existing files
I am not sure what my script would need to look like to be able to do this.
(using win2k12)
Thank you
would use robocopy for this purpose.
http://www.windows-commandline.com/robocopy-switches-syntax-examples/
http://social.technet.microsoft.com/wiki/contents/articles/1073.robocopy-and-a-few-examples.aspx
http://improve.dk/simple-file-synchronization-using-robocopy/
In this particular case:
robocopy c:\tocopy c:\dest1 /MIR /Z
robocopy c:\tocopy c:\dest2 /MIR /Z
/MIR makes dest mirror tocopy
/Z makes it so that the copy is restartable (depending on the size of the things you are copying you may not need this, but you probably want it when transferring files over the network or doing large copies
To use powershell, try the copy-item cmdlet:
Copy-Item c:\tocopy -Destination c:\dest1 -Recurse -Force
Copy-Item c:\tocopy -Destination c:\dest2 -Recurse -Force

robocopy /MIR - don't delete desktop.ini in destination

I want to sync folders between two computers, one with XP and one with Vista. I want the two folders mirrored, except for security settings and folder settings. It is my understanding that /MIR switch will delete any 'extra' files in the destination folder, which would include the desktop.ini files. I can avoid copying desktop.ini files with /XA:SH How can I prevent robocopy from deleting the destination desktop.ini files?
If I have to do any extra scripting, I prefer PowerShell. But I hope robocopy can do it on its own.
Thanks.
/XF desktop.ini
Will exclude Desktop.ini (from copy or purge).
Replace the /MIR switch with /E, and don't use the /PURGE parameter.
Explanation: /MIR is the equivalent of using /E /PURGE, so by using /E without /PURGE, you achieve the results you desire.
Create a bat file so you can mirror the source at the destination and later once the mirror process is finish erase the files you desired.
For example:
robocopy SOURCE DEST /E /PURGE or /MIR or /E
command to erase recursively (test the command before running at production):
del /s DRIVe:\DESTINATION\desktop.ini
Hope this helps,
Luis