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

    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
                                • D Dalek Dave

                                  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 Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #23

                                  Dont think the .Net boys liked it though! :laugh:

                                  Morality is indistinguishable from social proscription

                                  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