WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileExist Check In Use

 Keywords: FileExist In USe Readable Writable ExtractAttachedFile

This article being edited.

Question:

My script's installation script bombs out when using ExtractAttachedFile if there's an existing file currently in use. Is there a test I can run prior to ExtractAttachedFile that would allow me to tell the user that file "xyzzy.dll is in use, stop existiing related processes, and try again?" I thought maybe if fileExist("xyzzy.dll") == 2, but that seems to be only for files that can't be read. Apparently fileExist(filename) == 3 is not an option in my version.

Answer:

After checking for existence, attempt to open the file for unshared writing. Trap any resulting error.
Article ID:   W17894
Filename:   FileExist Check In Use.txt
File Created: 2014:03:21:07:50:40
Last Updated: 2014:03:21:07:50:40