user3486019 user3486019 - 2 years ago 179
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%",

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download