Technext Posted July 16, 2010 Report Share Posted July 16, 2010 Hi,I am facing a problem with directory attribute. I have a script that creates a sub-directory inside a given dir. For example, the script creates directory 'auto' inside G:\root\The script then tries to MOVE a directory from a given location to G:\root\auto\The problem is that when it tries to perform the MOVE operation, it gets ‘Access Denied’ message. After some investigation, I found that the issue was with the parent directory G:\root. If I unset the Read-only attribute of only the G:\root folder ('auto' directory’s attribute is left as it is), the script successfully performs the MOVE operation.This script worked fine when I executed it for the first time. As this script is scheduled to run twice a day, I noticed that the script was failing at the MOVE operation every time.I am not sure why this is happening. :( This is weird for me because the issue seems to be with the parent folder and not the child folder that is actually getting created. Is there any way to rectify this behaviour? I am not sure whether ATTRIB command will work. I have to try it out.Any suggestions?Regards,GC Quote Link to comment Share on other sites More sharing options...
MANEMAN Posted July 17, 2010 Report Share Posted July 17, 2010 This script worked fine when I executed it for the first timeCan you post this script here please.People on all different levels read the posts and are very willing to learn.Your input is appreciated.Meanwhile, back to your most recent post:/>http://forums.windowsforum.org/index.php?showtopic=45698Did executing your 4.exe files along with a .bat file work out within the boundaries of the links that I gave you ? - Or do you think it beyond you level of expertise at this present moment in time ?If you have had a favourable result please publish it here, as we are very willing to learn.John. Quote Link to comment Share on other sites More sharing options...
Technext Posted July 23, 2010 Author Report Share Posted July 23, 2010 Hi John,This issue is fixed now. After few more tests, I realized that the problem was not with the parent folder attribute. I modified my script to test whether the same error occurs when I try to create a directory just inside G:\ instead of G:\root. The same error came up again. I thought of adding “ATTRIB –r G:\auto” before performing MOVE operation; still nothing happened. Then I was sure that there might be some issue with the source folder itself; I was correct this time.A log file in source folder was tied up to a process. After releasing that handle, everything is working fine now. :) Thanks for your inputs.Regards,GC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.