Avatar of reredok
reredok
Flag for Germany asked on

Powershell and robocopy

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
Powershell

Avatar of undefined
Last Comment
Qlemo

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
reredok

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Qlemo

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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy