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. The Lounge
  3. How to delete a file when it was using by others?

How to delete a file when it was using by others?

Scheduled Pinned Locked Moved The Lounge
tutorialquestion
23 Posts 7 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.
  • A Aric Wang

    If a file was open by other application,how to delete it and don't to close the caller.

    I am not a genius, but shed more sweat!

    1 Offline
    1 Offline
    1 21 Gigawatts
    wrote on last edited by
    #3

    Try Star unlocker assistant [^]

    "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

    A 1 Reply Last reply
    0
    • A AspDotNetDev

      Politely ask that they drop off the file folder on your desktop after they are done with it.

      [Forum Guidelines]

      A Offline
      A Offline
      Aric Wang
      wrote on last edited by
      #4

      I mean delete a file who protected by system drivers.When you delete ,the system warning that "It's using by others".

      I am not a genius, but shed more sweat!

      1 Reply Last reply
      0
      • 1 1 21 Gigawatts

        Try Star unlocker assistant [^]

        "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

        A Offline
        A Offline
        Aric Wang
        wrote on last edited by
        #5

        If we do not use other tools.We write a code to do it.How to do?What's the principle?

        I am not a genius, but shed more sweat!

        C 1 Reply Last reply
        0
        • A Aric Wang

          If a file was open by other application,how to delete it and don't to close the caller.

          I am not a genius, but shed more sweat!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #6

          This, to me is a big oversite in Windows and causes massive headaches for developers because you CANNOT force a file close from the kernel. The applicaitn HAS to close the file handle before that file can be deleted. This affects hardware, and plug and play, in a really unpleasant manner: The app does a CreateFILe() on some kernel object, COM99 say. The device supporting COM99 gets surprise removed but the app has the hanlde open. The driver thus gets locked in memory, but has no HW underneath it. On replugging, this can caiuse all kinds of **** ups. Especialy on multifunction devices. New driver instances, ndis failure, and so on. Microsoft silution is for apps to register for plug and play events. A two stage process, and fairly unpleasant for many applicatin coders to implemet, even if they knew about it in the first place. This, is a ****ing disaster. It wold be far better if the driver could notify the IO manager of a file close, allow the driver to unload, and the IO manager just return 'devide not present' or some such to the app. So Microsoft, get on with it! Oh, and if you didnt understand what I wrote, the answer is you cant.

          Morality is indistinguishable from social proscription

          A 1 Reply Last reply
          0
          • L Lost User

            This, to me is a big oversite in Windows and causes massive headaches for developers because you CANNOT force a file close from the kernel. The applicaitn HAS to close the file handle before that file can be deleted. This affects hardware, and plug and play, in a really unpleasant manner: The app does a CreateFILe() on some kernel object, COM99 say. The device supporting COM99 gets surprise removed but the app has the hanlde open. The driver thus gets locked in memory, but has no HW underneath it. On replugging, this can caiuse all kinds of **** ups. Especialy on multifunction devices. New driver instances, ndis failure, and so on. Microsoft silution is for apps to register for plug and play events. A two stage process, and fairly unpleasant for many applicatin coders to implemet, even if they knew about it in the first place. This, is a ****ing disaster. It wold be far better if the driver could notify the IO manager of a file close, allow the driver to unload, and the IO manager just return 'devide not present' or some such to the app. So Microsoft, get on with it! Oh, and if you didnt understand what I wrote, the answer is you cant.

            Morality is indistinguishable from social proscription

            A Offline
            A Offline
            Aric Wang
            wrote on last edited by
            #7

            Thank you anyway,yes I can't.Can you give me some sinppets on how to do?I deeply known that it's not good to do that.It's a "*.txt" file protected by others.When you delete it,the system warning "It is being used by another person or program."

            I am not a genius, but shed more sweat!

            A L 2 Replies Last reply
            0
            • A Aric Wang

              Thank you anyway,yes I can't.Can you give me some sinppets on how to do?I deeply known that it's not good to do that.It's a "*.txt" file protected by others.When you delete it,the system warning "It is being used by another person or program."

              I am not a genius, but shed more sweat!

              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #8

              Aric Green wrote:

              Can you give me some sinppets on how to do?

              He just said you can't. In fact, YOU just said you can't! So why are you asking for code of how to do it? And why are you asking in the Lounge?

              [Forum Guidelines]

              A 1 Reply Last reply
              0
              • A Aric Wang

                If we do not use other tools.We write a code to do it.How to do?What's the principle?

                I am not a genius, but shed more sweat!

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #9

                1 - you can't 2 - you ignored a message saying 'no programming questions in the lounge' to ask this asinine question

                Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                L 1 Reply Last reply
                0
                • A Aric Wang

                  Thank you anyway,yes I can't.Can you give me some sinppets on how to do?I deeply known that it's not good to do that.It's a "*.txt" file protected by others.When you delete it,the system warning "It is being used by another person or program."

                  I am not a genius, but shed more sweat!

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #10

                  Aric Green wrote:

                  Can you give me some sinppets on how to do?I

                  OK, you MAY not do it to use very correct English. ie it is IMPOSSIBLE to delete a file when it is in use (AKA has a handle open on it). If you know that app that has the open handle you could send it a WM_CLOSE. (SendWindowsMessage(), FindWindow() etc.) But be carefull dong this,. you can really ppiss users off by userping the GUI from them.

                  Morality is indistinguishable from social proscription

                  1 Reply Last reply
                  0
                  • A Aric Wang

                    If a file was open by other application,how to delete it and don't to close the caller.

                    I am not a genius, but shed more sweat!

                    N Offline
                    N Offline
                    Nagy Vilmos
                    wrote on last edited by
                    #11

                    Is this a question which I see before me, The subject toward coding? Come, let me answer thee. I care thee not, and yet I see thee cares. Art thou not, programming related, sensible To feeling out of place? or art thou but A troll of the forum, a false creation, Proceeding from the software-oppressed net?


                    Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                    1 L 2 Replies Last reply
                    0
                    • C Christian Graus

                      1 - you can't 2 - you ignored a message saying 'no programming questions in the lounge' to ask this asinine question

                      Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #12

                      Its not asinine. In what way is asking this quesiton, which is perfectly reasonable to ask, donkey like. Secondly, which prpgramming language forum should this quesiton go in when it isnt language related? As I have pointed out before, the failings of being language focused preclude this.

                      Morality is indistinguishable from social proscription

                      A D 2 Replies Last reply
                      0
                      • A AspDotNetDev

                        Aric Green wrote:

                        Can you give me some sinppets on how to do?

                        He just said you can't. In fact, YOU just said you can't! So why are you asking for code of how to do it? And why are you asking in the Lounge?

                        [Forum Guidelines]

                        A Offline
                        A Offline
                        Aric Wang
                        wrote on last edited by
                        #13

                        I want to tell him that the file protected by a "*.sys" driver,I just try to ask for some ideas. ;P Sorry!

                        I am not a genius, but shed more sweat!

                        L 1 Reply Last reply
                        0
                        • L Lost User

                          Its not asinine. In what way is asking this quesiton, which is perfectly reasonable to ask, donkey like. Secondly, which prpgramming language forum should this quesiton go in when it isnt language related? As I have pointed out before, the failings of being language focused preclude this.

                          Morality is indistinguishable from social proscription

                          A Offline
                          A Offline
                          Aric Wang
                          wrote on last edited by
                          #14

                          You are right!Why can't they be polite!

                          I am not a genius, but shed more sweat!

                          1 Reply Last reply
                          0
                          • N Nagy Vilmos

                            Is this a question which I see before me, The subject toward coding? Come, let me answer thee. I care thee not, and yet I see thee cares. Art thou not, programming related, sensible To feeling out of place? or art thou but A troll of the forum, a false creation, Proceeding from the software-oppressed net?


                            Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                            1 Offline
                            1 Offline
                            1 21 Gigawatts
                            wrote on last edited by
                            #15

                            Doth my eyes deceive me? Is this Nagy Vilmos in prose?

                            "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

                            N 1 Reply Last reply
                            0
                            • L Lost User

                              Its not asinine. In what way is asking this quesiton, which is perfectly reasonable to ask, donkey like. Secondly, which prpgramming language forum should this quesiton go in when it isnt language related? As I have pointed out before, the failings of being language focused preclude this.

                              Morality is indistinguishable from social proscription

                              D Offline
                              D Offline
                              Dalek Dave
                              wrote on last edited by
                              #16

                              Vista/Windows 7 forum perhaps. But generally you have a point.

                              ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                              L 1 Reply Last reply
                              0
                              • 1 1 21 Gigawatts

                                Doth my eyes deceive me? Is this Nagy Vilmos in prose?

                                "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

                                N Offline
                                N Offline
                                Nagy Vilmos
                                wrote on last edited by
                                #17

                                -fesses up- You'll never geuess what I was reading last night.


                                Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                                1 1 Reply Last reply
                                0
                                • N Nagy Vilmos

                                  -fesses up- You'll never geuess what I was reading last night.


                                  Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                                  1 Offline
                                  1 Offline
                                  1 21 Gigawatts
                                  wrote on last edited by
                                  #18

                                  Tut tut tut. You'll be walking around in baggy pants and funny hats soon. Ohh, no, wait...that's MC Hammer...

                                  "If you can't explain it simply, you don't understand it well enough" ~ Albert Einstein "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." ~ Paul Neal "Red" Adair

                                  1 Reply Last reply
                                  0
                                  • D Dalek Dave

                                    Vista/Windows 7 forum perhaps. But generally you have a point.

                                    ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                                    L Offline
                                    L Offline
                                    Lost User
                                    wrote on last edited by
                                    #19

                                    Its also 2k XP behaviour. Thanks though for recognising that this post did deserve a valid answer rather than abuse.

                                    Morality is indistinguishable from social proscription

                                    1 Reply Last reply
                                    0
                                    • A Aric Wang

                                      I want to tell him that the file protected by a "*.sys" driver,I just try to ask for some ideas. ;P Sorry!

                                      I am not a genius, but shed more sweat!

                                      L Offline
                                      L Offline
                                      Lost User
                                      wrote on last edited by
                                      #20

                                      No, its not protected by a sys file, a driver. In fact drivers have very little power of thier own,. They are totally uinder controll of the OS. In fact it is 'protected', locked is a better word, by the app/IO manager.

                                      Morality is indistinguishable from social proscription

                                      1 Reply Last reply
                                      0
                                      • N Nagy Vilmos

                                        Is this a question which I see before me, The subject toward coding? Come, let me answer thee. I care thee not, and yet I see thee cares. Art thou not, programming related, sensible To feeling out of place? or art thou but A troll of the forum, a false creation, Proceeding from the software-oppressed net?


                                        Panic, Chaos, Destruction. My work here is done. or "Drink. Get drunk. Fall over." - P O'H

                                        L Offline
                                        L Offline
                                        Lost User
                                        wrote on last edited by
                                        #21

                                        Out damned dot (net) out!

                                        Morality is indistinguishable from social proscription

                                        D 1 Reply Last reply
                                        0
                                        • L Lost User

                                          Out damned dot (net) out!

                                          Morality is indistinguishable from social proscription

                                          D Offline
                                          D Offline
                                          Dalek Dave
                                          wrote on last edited by
                                          #22

                                          Ah, some culture at last!

                                          ------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave

                                          L 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