# File Locking problems

**URL:** https://www.finalbuilder.com/forums/t/file-locking-problems/2628
**Category:** Bugs
**Created:** [May 4, 2006, 11:37am UTC](https://www.finalbuilder.com/forums/t/file-locking-problems/2628 "2006-05-04T11:37:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [May 4, 2006, 11:37am UTC](https://www.finalbuilder.com/forums/t/file-locking-problems/2628/1 "2006-05-04T11:37:03Z")

</div>

I’m having two file locking problems, and I’m not quite sure how these are occuring within FB.  
  
I have a DLL that I copy over from another machine, register, run a couple of the ActiveXObjects (Using Javascript), unregister, and continue on my way. What this does is:  
  
1) Once the DLL is registered, Run, and then unregistered, I can not delete it. This means that I have to restart Final Builder every single time as the file is locked until I do.  
  
2) The files that the DLL acts upon also remain locked. Part of the process after unregistering it is to rename the files/directories that it acted upon. However, I can not do this because the files are locked as well until I restart FB.  
  
Is there something funky I have to do in order to release this lock? I’ve already tried doing the object = null in the javascript that creates and runs this object, but hat doesn’t seem to help.

---

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [May 5, 2006, 12:35pm UTC](https://www.finalbuilder.com/forums/t/file-locking-problems/2628/2 "2006-05-05T12:35:36Z")

</div>

As a follow up, I’ve tried both “delete” and “= null” and tried VBScript as well. It appears that FinalBuilder is the owner creating the ActiveXObject instead of the action as a control. As such I have to close final builder in order to release this ActiveXObject. This does not work because I have to act upon the DLL that the ActiveXObject was created from. ![]( "Sad")

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [May 5, 2006, 2:14am UTC](https://www.finalbuilder.com/forums/t/file-locking-problems/2628/3 "2006-05-05T02:14:44Z")

</div>

Hi Trevor  
  
Unfortunately this is a known issue (Raoul reported it a while back). The problem is that once the Active Scripting engine had loaded the dll into memory, it will hang onto the file until the process hosting the engine (finalbuilderin this case) is shutdown. I have tried unloading the scripting engine completely from finalbuilder once each script has finished running, unfortunately this doesn’t seem to help (my guess is the scripting engine doesn’t completely unload from the process).

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [May 5, 2006, 4:09am UTC](https://www.finalbuilder.com/forums/t/file-locking-problems/2628/4 "2006-05-05T04:09:57Z")

</div>

Trevor,  
  
A possible work-around for this is to create a .vbs file which does the stuff you need to do in there, and call it using cscript. Then when the cscript process completes, it shouldn’t hold on to the dll.  
  
hth.  
.t8

---

<div class="post-metadata">

### Author: ![tmchardy](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/dbc845/32.png) [@tmchardy](https://www.finalbuilder.com/forums/u/tmchardy)
#### Post date: [May 5, 2006, 8:31am UTC](https://www.finalbuilder.com/forums/t/file-locking-problems/2628/5 "2006-05-05T08:31:01Z")

</div>

This was my workaround as well (well, a .js, but close enough). Seems to work fine doing this. But it does mean that I have to depend on even _more_ external files. ![]( "Smile") My “Misc” dir is growing. ![]( "Smile")
