Unlock file with unlocker from WinForms application?
I am trying to unlock a file from a C # program using unlocker.
In my UI, I put on a button to unlock a file that the application cannot delete. When the user presses the button, I want to open the unlock (famous app).
I've read Unlocker on the net and there are some explanations on how to use the command line, but nothing seems to work.
I write the following code, but nothing happens:
"c: \ Program Files \ unlocker \ unlocker.exe" -L "PATHFORTHEFILE.doc"
Nothing happens. I've tried with no parameters and with -LU.
Any idea?
Anything more efficient than unlocking to integrate it with your software?
source to share
If unlock comes with -L and -U options, I don't think L will be the one you want to unlock with. Probably U to unlock;)
If you have any control over the application that is blocking the file, it would be a better solution for that program to release the file and not a third party application, tearing it up that way.
source to share
Check the documentation for the System.Diagnostics.Process class and the corresponding ProcessStartInfo class.
source to share