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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to Unlock a file

How to Unlock a file

Scheduled Pinned Locked Moved C / C++ / MFC
helpalgorithmstoolstutorialquestion
10 Posts 4 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
    poda
    wrote on last edited by
    #1

    Dear Friends, I want to delete a file which is used by other application. When I try to delete that file,it shows error as "Cannot delete file: It is being used by another person or Program.Close any programs that might be using the file and try again." On searching Google, some utility programs like "Unlocker" does this. But I am in need of the code just only to unlock the file and delete it. Could anyone help me out please? Thanks

    H T P 3 Replies Last reply
    0
    • P poda

      Dear Friends, I want to delete a file which is used by other application. When I try to delete that file,it shows error as "Cannot delete file: It is being used by another person or Program.Close any programs that might be using the file and try again." On searching Google, some utility programs like "Unlocker" does this. But I am in need of the code just only to unlock the file and delete it. Could anyone help me out please? Thanks

      H Offline
      H Offline
      Hamid Taebi
      wrote on last edited by
      #2

      What file that you want to delete ir depends to OS or other programs?

      P 1 Reply Last reply
      0
      • H Hamid Taebi

        What file that you want to delete ir depends to OS or other programs?

        P Offline
        P Offline
        poda
        wrote on last edited by
        #3

        Not OS locked. The file is "*.tds" file generated by Borland C++ (bcc32.exe) compiler.

        1 Reply Last reply
        0
        • P poda

          Dear Friends, I want to delete a file which is used by other application. When I try to delete that file,it shows error as "Cannot delete file: It is being used by another person or Program.Close any programs that might be using the file and try again." On searching Google, some utility programs like "Unlocker" does this. But I am in need of the code just only to unlock the file and delete it. Could anyone help me out please? Thanks

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          you can use "Process Explorer[^]" to find which application/process/thread uses the file (then up to you to kill it or not)

          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          R 1 Reply Last reply
          0
          • T toxcct

            you can use "Process Explorer[^]" to find which application/process/thread uses the file (then up to you to kill it or not)

            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            R Offline
            R Offline
            Rajesh R Subramanian
            wrote on last edited by
            #5

            I think he's looking for a way to achieve it programmatically.

            Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

            T 1 Reply Last reply
            0
            • R Rajesh R Subramanian

              I think he's looking for a way to achieve it programmatically.

              Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              i read and reread his post again, and still not sure about that ;) maybe a reply will guide...

              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              R 1 Reply Last reply
              0
              • T toxcct

                i read and reread his post again, and still not sure about that ;) maybe a reply will guide...

                [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                R Offline
                R Offline
                Rajesh R Subramanian
                wrote on last edited by
                #7

                poda wrote:

                But I am in need of the code just only to unlock the file and delete it.

                The quote is from the original message. I think the badly formatted message makes it difficult to read. :)

                Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

                1 Reply Last reply
                0
                • P poda

                  Dear Friends, I want to delete a file which is used by other application. When I try to delete that file,it shows error as "Cannot delete file: It is being used by another person or Program.Close any programs that might be using the file and try again." On searching Google, some utility programs like "Unlocker" does this. But I am in need of the code just only to unlock the file and delete it. Could anyone help me out please? Thanks

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

                  Yes I want to do it programatically. When we compile and link a project,the compiler will generate many files(like obj,map,ils,tds etc). One of them is .tds file. But this file is 'hold' by the IDE of Borland C++. How to release this 'lock' so that it can be deleted.

                  T 1 Reply Last reply
                  0
                  • P poda

                    Yes I want to do it programatically. When we compile and link a project,the compiler will generate many files(like obj,map,ils,tds etc). One of them is .tds file. But this file is 'hold' by the IDE of Borland C++. How to release this 'lock' so that it can be deleted.

                    T Offline
                    T Offline
                    toxcct
                    wrote on last edited by
                    #9

                    i don't know borland, but maybe if you just close the IDE, it will release the file, won't it ?

                    [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                    P 1 Reply Last reply
                    0
                    • T toxcct

                      i don't know borland, but maybe if you just close the IDE, it will release the file, won't it ?

                      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                      P Offline
                      P Offline
                      poda
                      wrote on last edited by
                      #10

                      Ofcourse,it will release the file. But I will use the linker to create DLL as a separate process for which the .tds file has to be deleted when the IDE is open. I need to know to how to release or unlock a file which is holding by a application. Thank you

                      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