I am having a problem adding a, much disapproved of, system() line into my c++ program.
I have the following:
1 2 3 4 5 6 7
#include <stdlib.h>
int main()
{
system("for /R DIR %a in (*) do (ren "%a" "%~na")");
return 0;
}
I receive errors during compilation in VC.
If I change "%a" and "%~na" to %a and %~na, compilation is successful, but the batch command does not work properly as it will not process filenames with spaces unless the "" are around the %a.