c - Can't call system with white space in parameter -


i'm trying make system call work. it works in case there no space in address, doesn't work if there's space in address...

this call copies file 1 place another.

how escape space in code properly?

char buffer[300]; snprintf(buffer, sizeof(buffer), "copy %s\\%s %s", assistpath, apifilename, path); system(buffer); 

space matter? why don't try code?

snprintf(buffer, sizeof(buffer), "copy \"%s\\%s\" \"%s\"", assistpath, apifilename, path); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -