1

I am trying to execute the following command in Inno Setup:

move "MyFolder\Extra\Tesseract-OCR" "MyDestFolder"

I tried using:

Filename: "{cmd}"; Parameters: 'move ' + "MyFolder\Extra\Tesseract-OCR" + ' ' + "MyDestFolder"';

and

Filename: "{cmd}"; Parameters: 'move ' + AddQuotes(MyFolder\Extra\Tesseract-OCR) + ' ' + AddQuotes(MyDestFolder)';

But none of them worked.

Which approach should I follow?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Marcelo Gazzola
  • 907
  • 12
  • 28
  • I got the error: *Mismatched or misplaced quotes on parameter* as expected. Here the exactly line: `Filename: "{cmd}"; Parameters: 'move "{app}\Extra\Tesseract-OCR" "{commonpf32}"'; StatusMsg: "Installing Tesseract OCR..."` – Marcelo Gazzola Jan 16 '20 at 02:02
  • 1
    Ah. That's different than what you asked in your question. You should edit it to indicate exactly what you're asking. You didn't mention `{app}` or `{commonpf32}` at all in your question or in your sample code. – Ken White Jan 16 '20 at 02:09
  • See [Inno Setup parameter with quotes in \[Run\] section](https://stackoverflow.com/q/15821436/850848). – Martin Prikryl Jan 17 '20 at 19:57

1 Answers1

2

Quotes can be embedded; just double them. Also, if you intend to use the cmd.exe move command, you would need the /c parameter. You might also consider using /y or as a parameter for the move command (depending on your needs).

Filename: "{cmd}"; Parameters: "/c move /y ""MyFolder\Extra\Tesseract-OCR"" ""MyDestFolder"""

/y would overwrite the file if it exists.

Bill_Stewart
  • 22,916
  • 4
  • 51
  • 62