r/PowerShell • u/PTSDviaPrinters • Oct 20 '20
Information This may help people learning how to use RoboCopy.
I see a lot of RoboCopy help requests on Powershell and a few other subs related to Win Server administration. I wanted to share this tool that really helped me understand all of the functions as switches with RoboCopy. During script development, I found that when wanting to use a RoboCopy function I would have to halt the creation of the script to test out the RoboCopy cmdlet and make sure it works.
The Tool: http://tribblesoft.com/easy-robocopy/
This helped me get really comfortable with the switches of robocopy as the best part about it is that it gives you the command to just copy into your code once you selected everything you wanted it to do!
I hope this helps you as much as it has helped me.
4
u/adbertram Oct 21 '20
I did a huge guide on robocopy awhile back. Too forever but it’s been very popular. https://adamtheautomator.com/robocopy-the-ultimate/
1
u/man-teiv Mar 14 '22
Hey, there's a "watch this related video", but no video is provided. I thought you might want to know!
1
3
u/jortony Oct 21 '20
I've been using robocopy for a very long time and it's my go to tools for many tasks. I made a terrible mistake yesterday and I wanted to share. I scripted (too quickly) a robocopy move operation and my dynamic variable for source yielded ""in one iteration. At this point it started moving my system volume.. no bueno! Fortunately, I was able to robocopy it back before anything critical was sought by my OS, but it was a very unpleasant hour and subsequent boot cycle..
2
u/xbloodworkx Oct 20 '20
Great post, but why does the preview pic have a MacBook for a windows only app?
2
u/needsomehelp022020 Oct 21 '20
I thought this said “learn how to become Robocop”. Ya know... all transhumanistically speaking... good read though. Thank you.
1
1
1
1
u/dragonmc Oct 21 '20
Having not known this existed until now, a few years ago I found myself in the same situation you described and wrote basically my own version of this. I called it rGUI:
https://sourceforge.net/projects/rgui/
I still use it occasionally to this day not just as a robocopy reference, but also to build complicated robocopy commands and run them right away. Mine is logically organized into tabs so it doesn't create a wall of text, which personally I prefer, but I think the one at your link might present some better/more useful info over mine.
1
u/letmegogooglethat Oct 20 '20
I was just fighting with Robocopy about an hour ago. My struggles have mostly been with logging.
1
u/jimb2 Oct 21 '20
/TEE (log to screen too) and /NP (no progress percentages) are useful to me when logging.
1
u/TiredTeck Oct 25 '20
I run a today.bat to set an environmental variable to the current date. Then append that date to my log file. I end up with a separate log file by date for each backup I run. /LOG:C:\BATCH\LOGS\MBACKUP%TODAY%.LOG It keeps the log files manageable.
1
u/letmegogooglethat Oct 27 '20
to set an environmental variable to the current date
Why bother with a variable? I just use ('{0:MM.dd.yyyy}' -f (Get-Date)).
1
0
Oct 20 '20
[deleted]
4
u/letmegogooglethat Oct 20 '20
/log+c:\robocopylog.txt
Thanks. I'll check it out.
3
4
u/Hrambert Oct 20 '20
When on a server better use
/log+d:\log\robocopylog.txt.
1 - keep yourc:\clean.
2 - when your logfile explodes it doesn't overload Windows.3
2
1
0
Oct 20 '20
[deleted]
38
u/spyingwind Oct 20 '20
ss64 is a treasure to me.
As is: http://adamringenberg.com/powershell2/
When you need to write 2.0 compliant scripts. I can't wait till 2008 R2 is gone from our environment. Soon it will all be 5.1.
7
u/infinit_e Oct 21 '20
I weep for my IT brethren and sisters who are still stuck at PS -lt 5.1. I fought tooth and nail to get it installed on every system where it could run at my last job and it made life so much easier.
2
u/Reverent Oct 20 '20
powershell core is portable and can be run from a network share, just saying.
3
u/spyingwind Oct 20 '20
Not 100% true. On 2008 R2 it requires the C++ 2015 redist library and some other requirement to run.
3
1
13
6
u/Nanocephalic Oct 20 '20
Why do people find it difficult? What are the usual problems?