프로그램을 사용하여 휴지통을 비울 수 없습니다. "파일 경로가 지정되지 않았습니다"오류가 발생합니다. command in the command prompt 지나서 완벽하게 작동하지만 c 프로그램에서는 작동하지 않습니다. 관리자 모드에서 Visual Studio를 실행 해 보았습니다.C 프로그램을 사용하여 휴지통 비우기
int BinFiles()
{
char folderCommand[]= "rd /s %systemdrive%\$Recycle.bin";
system(folderCommand);
return 0;
}
당신이 system''에 전달할 문자열 값으로 환경 변수를 대체하려고 했습니까? – harper
\ 대신 /와 \\를 사용하십시오. –
[코드에서 파일 경로에 이중 백 슬래시를 사용해야하는 이유는 무엇입니까?] (http://stackoverflow.com/questions/28328052/why-do-i-hhy-do-i-have-to-use-double-backslashes- for-file-paths-in-code) – sashoalm