Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSTS Windows Machine file copy robocopy not found

So we're setting up a release where we want to copy some artifacts to a target server in order to start a deploy. unfortunately when the task starts it errors out on the actual copy with the following error:

The term 'robocopy' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

However when checking both source and target machine the robocopy command (both from Powershell and CMD.exe run perfectly and presents the default robocopy starting screen.

We're using a private build agent running windows server 2016.

I've checked PATH variables and C:\Windows\System32 is in the list and running a search on both systems gives back robocopy.exe in the same directory.

running the task on a hosted agent makes it run fine. So it definitely is a local issue, just don't see where this might be coming from.

results of echo %PATH% and robocopy on the build agent: Echo

Results of the Release with the failing task:

Release

As requested by Shayki the task definition:

TaskDef

like image 607
Tsteenbakkers Avatar asked Oct 12 '25 00:10

Tsteenbakkers


1 Answers

for some unknown reason the %PATH% variable would show C:\Windows\System32 when doing echo %PATH% however when going through the environment variables inside control panel there was no entry for it inside the PATH environment variable.

Added the C:\Windows\System32 folder back into PATH system environment Variables (and putting it on top) fixed it for us.

like image 133
Tsteenbakkers Avatar answered Oct 16 '25 07:10

Tsteenbakkers