Tuesday, November 30, 2010

TFS 2010 InvokeProcess & command line commands

The InvokeProcess activity is an activity that you can use to start an external process from the build workflow. There seems to be quite a bit of documentation online stating that you can set the file name property to various DOS commands (xcopy, move, del, etc). However, I've never been able to get this to work. I was however able to get c:\windows\system32\cmd.exe /c [YOUR COMMAND HERE] to work. Which makes sense the InvokeProcess is just wrapping the .net Process class which is not a command line it's a Windows process.

1 comment:

James said...

what is the /c for? That doesnt seem to work. Mine isnt working, what i have is below. I am trying to call an ant script from the cmd.

args: """C:\apache-ant-1.7.1\bin\ant"" -buildfile ""C:\Builds\12\Deep Green\NallSuite\Sources\KiwaEsri93\build.xml"""

FileName:"c:\windows\system32\cmd.exe"

workingdir:"c:\windows\system32\"