Solved

How can I check with vbscript whether a folder is in use ?

Posted on 2007-03-23
3
294 Views
Last Modified: 2008-02-01
OS : Windows xp
0
Comment
Question by:itbabe
  • 2
3 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18778767
I don't believe you'll be able to do that...
To my knowledge that information is not stored anywhere.

But perhaps I've misunderstood your question - what do you mean by folder in use?
0
 

Author Comment

by:itbabe
ID: 18779151
When you want to rename  a folder and 1 of the files of the folder is in use,  it cannot be renamed.  Before attempting to rename the folder,  the script should check whether any of its files is in use.
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18779185
I think you'll need to be more reactive in that regard...
Something like

on error resume next
'code to rename folder
If err.Number <> 0 Then 'error occurred
  wscript.echo "Can't rename the folder."
End If
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB Script/Batch: create/remove folders based on a config sheet. 7 49
Attention Please 10 48
Restart service script 5 14
batch file or script 4 25
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question