×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Access Denied message for commands executed from batch file that work in Windows

Access Denied message for commands executed from batch file that work in Windows

Access Denied message for commands executed from batch file that work in Windows

(OP)
Hi Everyone,
Our image storage system is moving its staging folders to a new file share. We have been given full control access to the folders our system writes the images to.
Our system creates post processing bat files to perform actions after the images are generated and in some cases this includes a command to delete temporary files but I have discovered that when executed from a bat file the command is receiving an Access Denied error. Interestingly when I access the folders in Windows Explorer I can delete the files, just not when it is executed from a command prompt.
I have manually checked the permissions in the folder and the individual files and we appear to have the access we need so I am at a loss to explain why it fails when executed from a bat file.

This system has been in place for years, the only change is the new file share. I am still trying to get details on the nature of that file share such as if it is NAS, SAN or just a direct share on a Windows or Linux server.

Has anyone seen this issue before? Any thoughts on what could be wrong? The permissions are assigned through an Active Directory group and they are inherited from a higher level. Is there a chance there are restrictions applied that I am not able to see?

Any thoughts or suggestions would be appreciated.

Thanks.
Trent

At my age I still learn something new every day, but I forget two others.

RE: Access Denied message for commands executed from batch file that work in Windows

(OP)
The issue seems to be related to using UNC paths in the command. Searching the internet I find all sorts of similar issues but all of the responses are saying that UNC paths are not supported and to map a drive.
This setup is working perfectly on the existing file share using UNC paths so there must be something else causing the problem. Also, others had issues with move or copy commands and UNC paths while I do not have those problems, only an issue with delete.

I have attempted using a net use command without mapping a drive to the file share in the hopes it was an issue with the credentials but it made no difference. Should the server need rebooting after setting up credentials with net use for a network location?

We have in the past had a lot of issues with mapped drives disappearing and causing production outages so I would prefer not to have to rely on them. In Server 2003 we had to use stored credentials but they do not seem to be working in 8.1 at least for this issue. It does not really seem to be an issue with credentials anyway since all other commands work.

At my age I still learn something new every day, but I forget two others.

RE: Access Denied message for commands executed from batch file that work in Windows

(OP)
We found the solution was to add the AD group to the top level of the share with Read permissions.
The group was set with full permissions on a sub-level folder and though it showed the rights as being full it would not allow a delete operation to occur from a bat file using an UNC path.
Once the same group was added at the top level share with Read access the problem went away.
I do not have an explanation as to why this works yet but am still looking.
I post this solution in case anyone else has a similar issue.
Please let me know if this question should have been posted in another forum. If this is the correct forum we could use someone with knowledge of Active Directory.

At my age I still learn something new every day, but I forget two others.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close