Why batch file need admin to run

Santiago Marco 0 Reputation points
2023-03-11T14:33:29.8566667+00:00

I have created a batch file that prompts the user for a source and destination folder, and runs robocopy on that data.

but if I don't run it as administrator it doesn't work correctly since it only loops the question to enter the source directory.

Why is this happening? Is there a way to fix it and run it without administrator permissions, since I don't have those permissions

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,814 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MotoX80 32,326 Reputation points
    2023-03-11T16:27:42.02+00:00

    You have to modify the permissions to grant your users account access.

    For example, on this folder, only Administrators and the System account have access. While your account may be a member of the Administrators group, UAC would still need you to elevate permissions to "Run as administrator".

    User's image

    Grant the user account like Testuser here, or a group like Users access so that you don't need UAC elevation.

    User's image

    More info here: https://www.bing.com/search?q=how+ntfs+permissions+work

    0 comments No comments