Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Simple evc++ exe to delete target files/folder for ppc

Simple evc++ exe to delete target files/folder for ppc

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    ZapMe1
    wrote on last edited by
    #1

    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

    M 1 Reply Last reply
    0
    • Z 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

      M Offline
      M Offline
      Mohammad A Gdeisat
      wrote on last edited by
      #2

      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

      Z 1 Reply Last reply
      0
      • M Mohammad A Gdeisat

        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

        Z Offline
        Z Offline
        ZapMe1
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • Z ZapMe1

          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

          M Offline
          M Offline
          Mohammad A Gdeisat
          wrote on last edited by
          #4

          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, Mohammad

          And ever has it been that love knows not its own depth until the hour of separation

          Z 1 Reply Last reply
          0
          • M Mohammad A Gdeisat

            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, Mohammad

            And ever has it been that love knows not its own depth until the hour of separation

            Z Offline
            Z Offline
            ZapMe1
            wrote on last edited by
            #5

            Thank you for that Mohammad, but not having luck getting to compile. :(

            ZapMe1

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups