Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now