3

I need to run a simple command line within teamcity

FINDSTR /M /N /P /S /R /C:"goto end" D:\blabla\*

The double quote are replaced and somehow doubled when teamcity calls the command. The resulting command is

cmd.exe /c FINDSTR /M /N /P /S /R "/C:"goto end""

Which fails.

How can I prevent this from happening? The value for param /C requires a param with double quotes in my case. thanks

Biswajit_86
  • 3,661
  • 2
  • 22
  • 36
NicolasW
  • 1,519
  • 5
  • 22
  • 34

2 Answers2

0

Put your command in a batch file and call that passing in whatever arguments (if any) you need.

Whenever you do anything like this on windows, always do this :)

Ed Elliott
  • 6,666
  • 17
  • 32
0

Your example:

FINDSTR /M /N /P /S /R /C:"goto end" D:\blabla\*

Works as-is, in TeamCity 2018.1.3, using a Command Line runner with the above specified in the Custom Script section.

testworks
  • 386
  • 1
  • 10