unable to delete or rename locked .msi file

  • 12 years ago

    I have 2 problems that result in the same error message :

     'The process cannot access the file because it is being used by another process.'

    My project allows the user to right click on an .msi file within explorer (xp) and that file is then opened for editing. One of the functions I then need to do is rename the file.

    Also, if there is a transform (.mst) file in the folder it will also open this file. To allow editing of this file, I create a backup .msi file to allow me to save any changes to a new transform file. This works fine, however when the new transform file has been created, I then wish to delete the backup.msi, but I am unable to.

    I have tried everything I can think of (Marshal.FinalReleaseComObject, Dispose()) to remove/rename the files, but they always remian in use until the vb.exe has stopped running.                                                                                                             

    Can anyone help?

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan