0

When running batch files in my system without "Run as an administrator" I get a "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access them". How can I enable their running without this option? I want to enable this for every batch file in the system, and not just particular ones. I use Windows 7.

0

2 Answers 2

0

Resources in Windows are protected by means of permissions. If a batch file attempts to access a resource in a manner not allowed by those permissions, then it will get that error. The only way to prevent a given batch file from receiving that error is to either run it as a user who has the necessary permissions, or to remove the conflicting permissions. There is no way to do the latter for every conceivable batch file without destroying the operating system.

1
  • The problem is I have administrator privileges. I used to run batch files without this problem and I didn't do anything to change my permissions explicitly in the last session that I was able to do that.
    – CantorDust
    Commented Dec 3, 2016 at 9:02
0

The problem was I've accidentally changed the system variable ComSpec (Advanced System Settings->Advanced-->Environment Variables) which is supposed to point to cmd.exe

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .