I want to know if it is possible to control UAC behaviour in command line. Like for example, can i make a batch script for UAC to prompt user with dialogue for elevation when i try make changes in protected folder. Now if i do copy command to protected folder if does not prompt for elevation instead it fails with error message 'access denied'. I dont want to disable it, but work with it. What language should i code in if i want to work with UAC.
1 Answer
There is no built-in tool for executing commands with elevated privileges. Here's what you can do:
Open the command prompt or batch file as an Administrator.
Use a third party tool like elevate:
This utility executes a command with UAC privilege elevation. This is useful for working inside command prompts or with batch files.