Archive: How to delete file forcefully


How to delete file forcefully
Hi all

I know that to delete any file using NSIS script we need to

use delete command but if some one wants to delete the file

which is in use (that is forcefull removal of file)


Use /REBOOTOK.

Stu


Re: How to delete file forcefully
thanks Afrow

I tried this delete /REBOOTOK filename but still its

not working. The problem is after uninstalltion if i

install my script it pops up message the this file can not

be open for writing . and my system is crashing.

even if i try to delete it manually I am geeting a message

can not delete file already in use.


I say /REBOOTOK because that means the file will be deleted on reboot. You should not delete files when they are locked by another process, although you can using a program such as this one.

Stu


thanks afrow but ther is restriction for me that i dont want to use any exe for this.

And the file i am trying to delete is a com dll create by me only

I am registering it

in Section -Post using

RegDLL filename

and unregistering it

in Section Uninstall

UnRegDLL filename

and then delete it in uninstall section

but its not getting deleted

and the problem occur when some body tries to install after uninstalling. Coz every time i am rewriting the dll while installation and its crashing my system with error that dll is already in use it is not possible to open it for writing


Without the exe I cannot help you really, unless you want to convert that exe code into a plugin.

Ideally, you should just ask the user to restart their computer after an uninstall.

Stu


but i dont know how to make plugins from and then how to call them during uninstallation


how to call sytem commands from NSIS script
Hi All

i just want to know that how do i call system command like "net use" form the NSIS script