Solved

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

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 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

11 Experts available now in Live!

Get 1:1 Help Now