#include <Windows.h> #include <tchar.h> int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { DeleteFile(_T("D:\\1.txt")); //參數:目標文件的完整路徑,只能刪除普通權限的文件,只讀文件需先去除只讀權限。 return 0; }