We help IT Professionals succeed at work.

Powershell and robocopy

reredok
reredok asked
on
209 Views
Last Modified: 2017-03-26
Hi Experts,

is there any way to ascertain if a robocopy call in Powershell support the /MT:n switch before running robocopy. Remember robocopy before Windows 2008 R2 Server have no /MT Switch.
$LASTEXITCODE give only "success" or "fail" (ERRORLEVEL) but not if the robocopy Version support the switch.

Thanks++

reredok
Comment
Watch Question

IT Consultant
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Qlemo"Batchelor", Developer and EE Topic Advisor
CERTIFIED EXPERT
Top Expert 2015

Commented:
There could be a more recent Robocopy somewhere copied to the system, but yes, the OS release check should work in general. Parsing e.g. robocopy help would be more reliable, though.