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. .NET (Core and Framework)
  4. Delete In Use File

Delete In Use File

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelpjsoncareer
8 Posts 3 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.
  • P Offline
    P Offline
    Polymorpher
    wrote on last edited by
    #1

    I have a need to build a class that can unlock in use files so that they can be deleted. I need to do this from within my code without using any third party executables. Preferably in VB.Net or C#.NET with the help of pinvoke for any api calls. Any sugestions or existing source would be a great help.

    -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

    D G 2 Replies Last reply
    0
    • P Polymorpher

      I have a need to build a class that can unlock in use files so that they can be deleted. I need to do this from within my code without using any third party executables. Preferably in VB.Net or C#.NET with the help of pinvoke for any api calls. Any sugestions or existing source would be a great help.

      -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Why would you want to do this? So you can crash the app that has the file open? That's about the only end result you're going to get.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      P 1 Reply Last reply
      0
      • P Polymorpher

        I have a need to build a class that can unlock in use files so that they can be deleted. I need to do this from within my code without using any third party executables. Preferably in VB.Net or C#.NET with the help of pinvoke for any api calls. Any sugestions or existing source would be a great help.

        -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

        G Offline
        G Offline
        Giorgi Dalakishvili
        wrote on last edited by
        #3

        Here you are: Deleting Locked Files[^]

        Giorgi Dalakishvili #region signature my articles #endregion

        P 1 Reply Last reply
        0
        • G Giorgi Dalakishvili

          Here you are: Deleting Locked Files[^]

          Giorgi Dalakishvili #region signature my articles #endregion

          P Offline
          P Offline
          Polymorpher
          wrote on last edited by
          #4

          Thanks, I will give this a try :)

          -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

          G 1 Reply Last reply
          0
          • P Polymorpher

            Thanks, I will give this a try :)

            -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

            G Offline
            G Offline
            Giorgi Dalakishvili
            wrote on last edited by
            #5

            Glad to help you.

            Giorgi Dalakishvili #region signature my articles #endregion

            P 1 Reply Last reply
            0
            • G Giorgi Dalakishvili

              Glad to help you.

              Giorgi Dalakishvili #region signature my articles #endregion

              P Offline
              P Offline
              Polymorpher
              wrote on last edited by
              #6

              Had to make some small modifications, but this worked perfectly for what i needed. Thanks alot

              -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

              G 1 Reply Last reply
              0
              • P Polymorpher

                Had to make some small modifications, but this worked perfectly for what i needed. Thanks alot

                -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

                G Offline
                G Offline
                Giorgi Dalakishvili
                wrote on last edited by
                #7

                You are welcome :)

                Giorgi Dalakishvili #region signature my articles #endregion

                1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Why would you want to do this? So you can crash the app that has the file open? That's about the only end result you're going to get.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  P Offline
                  P Offline
                  Polymorpher
                  wrote on last edited by
                  #8

                  I love the way half of the people on here seem to think they know more than everyone else and feel the need to tell you that what your doing is wrong and yet not offer a solution before they even take the time to ask what it is your really trying to do...your not someone special that we all need to here your words of wisdom and be corrected on what we are doing...I'm working on a project where it is at times necessary to delete a file that is in use if you can help(i don't need it anymore), then please do, if not, then don't go running around being the hallway monitor to see if anyone is running

                  -- "Keyboard not found. Press < F1 > to RESUME. " Source unknown (appears in many common BIOSes as a real error message)

                  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