user3486019 user3486019 - 1 year ago 140
Bash Question

C++ ShellExecute special characters

How can I run this command from ShellExecute?

With windows cmd, I use this line and works perfect:

C:\backup.exe -daily %date%

that results:

C:\backup.exe -daily 05/19/2016

But in C ++ the interpreter does not work with %.
It results:

C:\backup.exe -daily %date%

How can I solve this problem?

ShellExecute(NULL, NULL,
"-daily %date%",


Run cmd.exe /C backup.exe ... to let cmd take care of the variable substitution.