Delete folder and 'in use' warning? 
Author Message
 Delete folder and 'in use' warning?

Hi,

After I've run my JScript, I would like to clean up the mess I've made. I
know the folders I've created therefore I know which folders I can/should
delete.

Known problem is that folders can't be deleted when the explorer has focus
on them. But I often have the problem something is 'using' my folder and I
cannot delete it.
1. Does anyone know how to detect who/what is using this file/folder?
2. Is it possible to override this error?

I find that errors are given very easy by the FSO, I feel that the explorer
doesn't give as much errors as the FSO. Or is this imagination?

Thanks

Gert-Jan Hiddink
RepIT - Repository Information Technology
Raamsdonksveer - Holland

The code I'm using:

//pFso is pointer to FileSystemObject
function DeleteFolder(delFolder)
{
 var dF = delFolder;
 if (dF.substr(dF.length-1)== "\\")
 {
  dF = dF.substring(0, dF.length-1);
 }
 if (pFso.FolderExists(dF))
 {
  try
  {
   pFso.DeleteFolder(dF, true);
  }
  catch(err)
  {
   Handle_Error("DeleteFolder", err.number, err.description + " == " + dF +
"(Folder in use?!?)");
  }
 }

Quote:
}



Mon, 27 Jan 2003 03:00:00 GMT  
 Delete folder and 'in use' warning?
Did you open any files during the main processing, but not close them?

--

Bill James
Microsoft MVPDTS

?Free Win9x VBScript Utilities?
??New Address - Change your links!??
http://www.svvi.net/wgjames/vbspage/

Quote:

> Hi,

> After I've run my JScript, I would like to clean up the mess I've made. I
> know the folders I've created therefore I know which folders I can/should
> delete.

> Known problem is that folders can't be deleted when the explorer has focus
> on them. But I often have the problem something is 'using' my folder and I
> cannot delete it.
> 1. Does anyone know how to detect who/what is using this file/folder?
> 2. Is it possible to override this error?

> I find that errors are given very easy by the FSO, I feel that the explorer
> doesn't give as much errors as the FSO. Or is this imagination?

> Thanks

> Gert-Jan Hiddink
> RepIT - Repository Information Technology
> Raamsdonksveer - Holland

> The code I'm using:

> //pFso is pointer to FileSystemObject
> function DeleteFolder(delFolder)
> {
>  var dF = delFolder;
>  if (dF.substr(dF.length-1)== "\\")
>  {
>   dF = dF.substring(0, dF.length-1);
>  }
>  if (pFso.FolderExists(dF))
>  {
>   try
>   {
>    pFso.DeleteFolder(dF, true);
>   }
>   catch(err)
>   {
>    Handle_Error("DeleteFolder", err.number, err.description + " == " + dF +
> "(Folder in use?!?)");
>   }
>  }
> }



Mon, 27 Jan 2003 03:00:00 GMT  
 Delete folder and 'in use' warning?
I feel innocent, but the error seems to indicate I am guilty of opening a
file and not closing it. Though I cannot see any suspicious processes still
{*filter*} (using the NT-Taskmanager).
Why has Uncle Bill nothing implemented to detect WHO is 'using' a file.
I noticed that after a couple of minutes I can delete the folder using the
explorer. In the meantime I haven't closed any applications... Weird things
happen...

Gert-Jan



Did you open any files during the main processing, but not close them?

--

Bill James
Microsoft MVPDTS

?Free Win9x VBScript Utilities?
??New Address - Change your links!??
http://www.*-*-*.com/


Quote:
> Hi,

> After I've run my JScript, I would like to clean up the mess I've made. I
> know the folders I've created therefore I know which folders I can/should
> delete.

> Known problem is that folders can't be deleted when the explorer has focus
> on them. But I often have the problem something is 'using' my folder and I
> cannot delete it.
> 1. Does anyone know how to detect who/what is using this file/folder?
> 2. Is it possible to override this error?

> I find that errors are given very easy by the FSO, I feel that the
explorer
> doesn't give as much errors as the FSO. Or is this imagination?

> Thanks

> Gert-Jan Hiddink
> RepIT - Repository Information Technology
> Raamsdonksveer - Holland

> The code I'm using:

> file://pFso is pointer to FileSystemObject
> function DeleteFolder(delFolder)
> {
>  var dF = delFolder;
>  if (dF.substr(dF.length-1)== "\\")
>  {
>   dF = dF.substring(0, dF.length-1);
>  }
>  if (pFso.FolderExists(dF))
>  {
>   try
>   {
>    pFso.DeleteFolder(dF, true);
>   }
>   catch(err)
>   {
>    Handle_Error("DeleteFolder", err.number, err.description + " == " + dF
+
> "(Folder in use?!?)");
>   }
>  }
> }



Tue, 28 Jan 2003 03:00:00 GMT  
 Delete folder and 'in use' warning?
There are cases where a process will cache a file handle (even for a file that has been deleted).
Here's a KB article describing at least one instance involving IIS.  This may not be exactly the
problem in your case, but it could be something similar...

Q191742 - IIS: Access Denied When Trying to Update Files on IIS Computer
http://www.*-*-*.com/

--
Michael Harris
MVP Scripting

"It always helps to read the documentation first..."


I feel innocent, but the error seems to indicate I am guilty of opening a
file and not closing it. Though I cannot see any suspicious processes still
{*filter*} (using the NT-Taskmanager).
Why has Uncle Bill nothing implemented to detect WHO is 'using' a file.
I noticed that after a couple of minutes I can delete the folder using the
explorer. In the meantime I haven't closed any applications... Weird things
happen...

Gert-Jan



Did you open any files during the main processing, but not close them?

--

Bill James
Microsoft MVPDTS

?Free Win9x VBScript Utilities?
??New Address - Change your links!??
http://www.*-*-*.com/


Quote:
> Hi,

> After I've run my JScript, I would like to clean up the mess I've made. I
> know the folders I've created therefore I know which folders I can/should
> delete.

> Known problem is that folders can't be deleted when the explorer has focus
> on them. But I often have the problem something is 'using' my folder and I
> cannot delete it.
> 1. Does anyone know how to detect who/what is using this file/folder?
> 2. Is it possible to override this error?

> I find that errors are given very easy by the FSO, I feel that the
explorer
> doesn't give as much errors as the FSO. Or is this imagination?

> Thanks

> Gert-Jan Hiddink
> RepIT - Repository Information Technology
> Raamsdonksveer - Holland

> The code I'm using:

> file://pFso is pointer to FileSystemObject
> function DeleteFolder(delFolder)
> {
>  var dF = delFolder;
>  if (dF.substr(dF.length-1)== "\\")
>  {
>   dF = dF.substring(0, dF.length-1);
>  }
>  if (pFso.FolderExists(dF))
>  {
>   try
>   {
>    pFso.DeleteFolder(dF, true);
>   }
>   catch(err)
>   {
>    Handle_Error("DeleteFolder", err.number, err.description + " == " + dF
+
> "(Folder in use?!?)");
>   }
>  }
> }



Tue, 28 Jan 2003 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Outlook Empy 'Deleted Items Folder'

2. Outlook Empy 'Deleted Items Folder'

3. Using folder object when the user doesn't have access to the folder

4. using microsoft's move,copy,delete,rename applets

5. Enumerating a folder's files using fileSystemObject

6. Using WSH (VBScript) to change a folder's settings

7. Creating 'My Briefcase' Type Folders

8. A folder named '...'

9. WSH copy 'Special Folders'

10. Creating 'My Briefcase' Type Folders

11. Looking for free PS output filter that uses PDF's and DSC's

12. Using the 'LIKE' keyword

 

 
Powered by phpBB® Forum Software