Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


How to Force a File Close

Keywords: 	  shoot a file force a file close  wntFileClose fileclose

Question:

How can force FileDelete to delete a file even if its in use ?

Answer:

  1. There are functions like wntFileClose and such to force close files. Generally unpleasant for any application using it.

    You can also shoot the application involved. Kinda depends on the situation.

  2. From http://www.microsoft.com/downloads/release.asp?ReleaseID=10958

    DLL Inuse Utility for Replacing a DLL In Use by Operating System (inu_x86.exe):

    Inuse.exe provides individuals and administrators with "on-the-fly" capability to replace files that are currenly in use by the operating system. Although this behavior is generally accomplished by running a program's setup program or a service pack's upgrade program, the setup and upgrade process tends to replace multiple files. However, for troubleshooting purposes, you may need to replace an individual file on your computer versus an entire set of files.

    InUse is a Win32-based command-line utility that can be used by and within automated tasks, scripts, or other programs.

    Operating System - Windows NT 4.0 (Intel)

  3. If you are running Windows NT, there is the IntControl(30.... function, which performs a delayed file move. The file is not actually moved until the operating system is restarted. This can be useful for replacing system files. If you are running Win95 there is the WININIT.INI file - which incidentally is NOT and ini file and cannot be successfully edited with INI functions where you can put information to rename or delete files.

Article ID:   W14862