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. auto delete the files at specefic date and time.

auto delete the files at specefic date and time.

Scheduled Pinned Locked Moved C / C++ / MFC
7 Posts 5 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.
  • M Offline
    M Offline
    MahaKh
    wrote on last edited by
    #1

    i want to make an .exe which resides in any system's folder and on a specefic date and time it get active and delete all files in that specefic folder.

    _ C M D 4 Replies Last reply
    0
    • M MahaKh

      i want to make an .exe which resides in any system's folder and on a specefic date and time it get active and delete all files in that specefic folder.

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      Wow!!! Sounds like a typical virus attack.

      «_Superman_» I love work. It gives me something to do between weekends.
      Microsoft MVP (Visual C++)

      M 1 Reply Last reply
      0
      • _ _Superman_

        Wow!!! Sounds like a typical virus attack.

        «_Superman_» I love work. It gives me something to do between weekends.
        Microsoft MVP (Visual C++)

        M Offline
        M Offline
        MahaKh
        wrote on last edited by
        #3

        can u help me in tht...actualy its not particularly a virus....i want it to be useful for me to manage my data in my work...i want to discard the files after a certain time when here are no more needed. i want it in .exe form or any other.

        _ 1 Reply Last reply
        0
        • M MahaKh

          i want to make an .exe which resides in any system's folder and on a specefic date and time it get active and delete all files in that specefic folder.

          C Offline
          C Offline
          chandu004
          wrote on last edited by
          #4

          rather you can do like this. 1.write an exe, that reads the foldername and the date/time on which it has to be deleted, from a text file. 2.on execution, the exe reads a text file, that contains a lookup of the folder names and dates. 3.if the current time is beyond the time specified in the file, then delete the files from that folder. 4.now you can place this exe(shortcut) in the startup. 5.also you can write your exe in such a way that, it loops the above code once in an hour.

          -------------------------------------------- Suggestion to the members: Please prefix your main thread subject with [SOLVED] if it is solved. thanks. chandu.

          1 Reply Last reply
          0
          • M MahaKh

            i want to make an .exe which resides in any system's folder and on a specefic date and time it get active and delete all files in that specefic folder.

            M Offline
            M Offline
            Maximilien
            wrote on last edited by
            #5

            This is not a particulary difficult task to do. just create a service and set it with a periodic "heart-beat" to check the date, and when the date is right, delete the files in the folder.

            Watched code never compiles.

            1 Reply Last reply
            0
            • M MahaKh

              i want to make an .exe which resides in any system's folder and on a specefic date and time it get active and delete all files in that specefic folder.

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              You could do the same thing with a batch file and a scheduled task.

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Man who follows car will be exhausted." - Confucius

              1 Reply Last reply
              0
              • M MahaKh

                can u help me in tht...actualy its not particularly a virus....i want it to be useful for me to manage my data in my work...i want to discard the files after a certain time when here are no more needed. i want it in .exe form or any other.

                _ Offline
                _ Offline
                _Superman_
                wrote on last edited by
                #7

                As David said, I would recommend a scheduled task. Take a look at the ITaskScheduler[^] interface for starters.

                «_Superman_» I love work. It gives me something to do between weekends.
                Microsoft MVP (Visual C++)

                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