Batch files need administrator permission to run, How to cancel this?

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.

CantorDust

Posted 2016-11-30T20:13:30.200

Reputation: 21

Answers

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

CantorDust

Posted 2016-11-30T20:13:30.200

Reputation: 21

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.

kreemoweet

Posted 2016-11-30T20:13:30.200

Reputation: 3 884

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 – 2016-12-03T09:02:53.527