views:

937

answers:

3

I am trying to unlock a file from a C# program, using unlocker.

In my UI, I put a button to unlock the file the app couldn't delete. When the user pushes the button, I want unlocker (the famous app) to be opened.

I have read about in the Unlocker web, and there is some explanations about the commandline to use but nothing works.

I write the following code but nothing happens:

"c:\Program Files\unlocker\unlocker.exe" -L "PATHFORTHEFILE.doc"

Nothing happens. I have tried without parameters and with -LU.

Any idea?

Something more efficient than unlocker to integrate it with software?

A: 

Look at the documentation for the System.Diagnostics.Process class and the related ProcessStartInfo class.

EBGreen
I know how to do it, the problem is that I follow all the steps and the screen of Unlocker does not appear. In fact, nothing happens. the .NET part I think it's ok, i think the problem is how to use Unlocker.
netadictos
+1  A: 

If unlocker comes with parameters -L and -U, I don't think L would be the one you want to unlock with. Probably U is for unlocking ;)

If you have any control of the application that is locking the file, it would be a better solution to have that program free the file rather than a third party app rip it away like this.

Karl
A: 

unnlocker.exe c:\song.mp3 -s -d

-s unlock

-d delete