0

When I tried to execute

mysqldump --host="ean13.info" --user="user" --password="mypass" info_upm > c:\\mysql.sql through ShellExecute in visual C++ I receive

mysqldump ERROR: can not find table ">".

Execution this command through command line is OK. I understand that something happens with ">" character, but can not find what.

CLAbeel
  • 1,078
  • 14
  • 20

1 Answers1

2

ShellExecute is meant to execute the .exe (mysqldump in your case), whereas you're trying to also use it to redirect stdout to a file. You can't do that with ShellExecute.

CreateProcess is a better alternative, probably using pipes for the redirection or maybe ReadConsole.

See:

  1. Redirecting stdout output in cpp
  2. How do I redirect output to a file with CreateProcess?
Community
  • 1
  • 1
acraig5075
  • 10,588
  • 3
  • 31
  • 50