Access denied when running a command with InvokeProcess in a TFS team build

When you are trying to run a command line tool via the InvokeProcess activity in a TFS 2010 Team build you might see the somewhat confusing ‘Access denied’ error. There appears to be no more detail in the log.

I have found that this is usually down to a type on the filename property of the activity.

It should be set to something like

“c:\my tools\tool.exe”

but is actually set to

“c:\my tools”

i.e. it is set to the folder not the filename. An easy mistake to make of cutting and pasting paths in from batch files.

You cannot execute a folder, hence the access denied error. Simple but easy to miss.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>