2

I wanna to copy a file to build dist directory in Qt Creator Custom Build Step:

enter image description here But after I Build, the error thrown:

 Could not start process "copy" C:\Users\W\Desktop\StockKLine-master\StockKLine-master\dataKLine.txt C:\Users\W\Desktop\StockKLine-master\build-StockKLine-Desktop_Qt_5_11_2_MinGW_32bit-Debug\dataKLine.txt /Y

enter image description here

However I can test the command in the cmd.exe without error

enter image description here

How Can I copy a file to dist folder in Qt Creator Custom Build Step?

Blueman
  • 781
  • 10
  • 13
Moon soon
  • 2,616
  • 2
  • 30
  • 51

1 Answers1

5

copy is internal command for cmd. (See for example here)

You should use cmd to execute shell that will do the work and exit immediate (/c option), so it should looks something like:

Command: cmd

Arguments: /c copy %{sourceDir}\dataKLine.txt %{buildDir}\dataKLine.txt /Y

Other possibility will be to use xcopy:

Command: xcopy

Arguments: %{sourceDir}\dataKLine.txt %{buildDir}\dataKLine.txt /Y /I

Blueman
  • 781
  • 10
  • 13