Solved

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

Posted on 2007-03-23
3
288 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

770 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