0

I am trying to run a batch file automatically during a build from a TFS build workflow. I have added an InvokeProcess activity with the following:

    Arguments: "\\" + agent + " /accepteula -u username -p password -d C:\HelloWorld.bat"
    FileName: "PsExec.exe"
    OutputEncoding: System.Text.Encoding.GetEncoding(System.Globalization.CultureInfo.InstalledUICulture.TextInfo.OEMCodePage)
    WorkingDirectory: "C:\PSTools"

I have ensured that both the build agent and the build controller have access to the "agent" in question. I have also ensured the PsExec.exe is located in the "C:\PSTools" folder as defined.

When executing the build I get the error "File not found: PsExec.exe" Does anyone have any idea what would cause this error in this situation?

Aaron Davis
  • 281
  • 1
  • 5
  • 22

1 Answers1

2

You can try with FileName: "C:\PSTools\PsExec.exe"

Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51
  • Actually this worked like a charm... originally I thought it didnt but I tried running the build again and apparently the changes to the workflow had not saved correctly. Thanks a lot! – Aaron Davis Jun 25 '12 at 14:39
  • You responded faster than I could edit my comment, this was the correct answer I am not sure why though since I thought the Working directory was supposed to point to the directory that the "FileName" is contained in. – Aaron Davis Jun 25 '12 at 14:45
  • happy to answer your question Aaron and unlock your problem – Aghilas Yakoub Jun 25 '12 at 14:48