Another nasty Robocopy bug
Recently I wrote about bug I found in Robocopy - one of my favorite utilities... And today I found another one.
I am using robocopy for synchronization - which is VERY important part of our framework (if nothing is synchronized, nothing can be executed).
We use one folder for storing all log files. During migration to newer version of framework, I wanted to see only new entries for easier troubleshooting (many log files are not overwriting, but rather appending). So I renamed my Log folder to Log.Backup and tried to run synchronization... I run only backend part - that is part that is missing all checking, creation of required folders etc.
To my surprise my synchronization failed - when I renamed Log.Backup to Log again it was working.
Robocopy reported very strange error:
ERROR : Invalid Parameter #4 : "/Log+:C:\Temp\Log\Robocopy.log"
I am using same syntax for many years, so I was really surprised. I double checked robocopy version to be sure that I didnt accidentaly replaced it with some 3.11 version - nope, I was using current version.
Then I started to have that scary feeling that I know what is wrong - I tried to run it again, this time specifying folder that didnt exist - and I got same error as before.
To summarize it - if Robocopy is not able to write to file, it reports "Invalid parameter". If you specify that you want to store your settings in log file in folder that doesn`t exist - bang, "Invalid parameter".
Tested with newer and older versions of Robocopy - XP010 (Resource Kit), XP026 and XP027 (Vista).