Jump to content
Macro Express Forums

If Folder Ready?


Cory
 Share

Recommended Posts

I am writing a macro that renames a network folder which is likely to be locked because a user has a file open. But I don't see an "If Folder Ready" like the "If File Ready". I tried the later with the folder path but it reports that it's not ready in all cases. I had considered recursively looking at each file in the folder to check it any of them were not ready but it's possible that all files are ready and it could still be locked. For instance if someone have an explorer window open to that folder it will cause a lock. Doe anyone know if there's an easy way to determine if the folder is ready?

 

The best way I was able to think of so far was to create a batch file with the rename command and redirect the output to a file which I would read back in and if the file contains "Access is Denied" then I can run with that but this isn't a very elegant solution. The main benefit is that it doesn't error out and I can prompt the user to deal with it and repeat.

Link to comment
Share on other sites

Silence can speak a thousand words.... :)

 

Turns out there is no such functionality. After considering many options in the future I think I will test every file recursively and present the user with a list of locked files and if that results in no matches and the folder doesn't rename wit the normal rename command followed by an If Folder Exist then I know it's an explorer window that's open and I can report that to the users.

Link to comment
Share on other sites

Silence can speak a thousand words.... :)

Over the weekend I looked for some functionality in WMI. Nothing. I find it strange. There has to be something or else Windows could not pop up the error message that it does. I'll check out some API calls later. BTW doing a Google was pretty much useless, too.

Link to comment
Share on other sites

Kevin mentioned that he too had looked in their development environment for any such utility and came up empty. Strange isn't it? Anyway I made a feature request with ISS.

 

Unlocker looks interesting but I'm afraid it won't work in this environment as the targets are on an file server and I don't see that it can convince the server OS to give up it's locks. Also I try to avoid another application when I can in a distributed environment.

 

Thanks for all your help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...