Simple evc++ exe to delete target files/folder for ppc
-
Hello, I'd like to create a simple exe file with evc++, that when run, will Delete a certain folder / file in the ppc root directory. Can someone help me with this? Would also like for it to work on both 2330 and WM5 devices. Thank you in advance! :)
ZapMe1
-
Hello, I'd like to create a simple exe file with evc++, that when run, will Delete a certain folder / file in the ppc root directory. Can someone help me with this? Would also like for it to work on both 2330 and WM5 devices. Thank you in advance! :)
ZapMe1
use DeleteFile() API or SHFileOperation Function, both are supported under windows ce. Good Luck, Mohammad
And ever has it been that love knows not its own depth until the hour of separation
-
use DeleteFile() API or SHFileOperation Function, both are supported under windows ce. Good Luck, Mohammad
And ever has it been that love knows not its own depth until the hour of separation
-
Thank you for the fast reply, Mohammad. I actually would like to delete a subfolder that will contain 1-3 files. I'm sorry, I'm very new at this. Can you please give me an example? Thank you!
ZapMe1
lets assume that ur subfolder is named '\\MyFolder':
WIN32_FIND_DATA fd; CString MyFolder =_T("\\MyFolder\\"); HANDLE hFile = FindFirstFile(MyFolder +_T("*.*")), &fd); while(hFile != INVALID_HANDLE_VALUE) { if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))//not a folder { DeleteFile(MyFolder + fd.cFileName); } hFile = FindNextFile(hFile, &fd); } FindClose(hFile);
I did not test the code, but it gives the idea.. Good Luck, MohammadAnd ever has it been that love knows not its own depth until the hour of separation
-
lets assume that ur subfolder is named '\\MyFolder':
WIN32_FIND_DATA fd; CString MyFolder =_T("\\MyFolder\\"); HANDLE hFile = FindFirstFile(MyFolder +_T("*.*")), &fd); while(hFile != INVALID_HANDLE_VALUE) { if(!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))//not a folder { DeleteFile(MyFolder + fd.cFileName); } hFile = FindNextFile(hFile, &fd); } FindClose(hFile);
I did not test the code, but it gives the idea.. Good Luck, MohammadAnd ever has it been that love knows not its own depth until the hour of separation