こんな方法もあります。 <サンプル> #include <windows.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCommandLine, int cmdShow) { HANDLE hFind; WIN32_FIND_DATA fd; hFind=FindFirstFile(パス名,&fd); if (FindNextFile(hFind,&fd) || !lstrcmpi(ファイル名,fd.cFileName)) MessageBox(0,"指定のパスは存在します","結果",MB_ICONINFORMATION); else MessageBox(0,"指定のパスは存在しません","結果",MB_ICONERROR); FindClose(hFind); retur
![ファイルやディレクトリの存在確認を行う方法](https://cdn-ak-scissors.b.st-hatena.com/image/square/2217b5f8fd432f1f8e24e3387bf58ef8f86ddb50/height=288;version=1;width=512/https%3A%2F%2Foshiete.xgoo.jp%2Fimages%2Fsp%2Fqa_recommend%2F2101_4.jpg)