I can get the redirection to work from the command line but I cannot get the redirection to work from my C code. Any suggestions are greatly appreciated!
// This works: -hashfile command completed successfully.
memset(&tchar[0], 0, sizeof(tchar));
sprintf(tchar, "certutil -hashfile \"\%s\"\ MD5", output_file);
system(tchar);
This doesn't --> Error: Expected no more than 2 args, received 4
sprintf(tchar, "certutil -hashfile \"\%s\"\ MD5 ^> "\C:\\TEMP\\image.cksm\"\"", output_file);
There are problems with sprintf
's format argument which is invalid:
To make it work, change the code to:
sprintf(tchar, "certutil -hashfile \"%s\" MD5 > \"C:\\TEMP\\image.cksm\"", output_file);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.