Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Question
Friday, July 21, 2017 11:50 AM
Hi ,
I am using a batch file to execute a few command and when I use below command to disable UAC , I am getting access denied error.
Can anyone help me with this ? How this can be run as administrator when run the batch file ?
C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f
All replies (4)
Monday, July 24, 2017 7:05 AM
Hi Shimith,
Did you login Windows with a administrator account?
Did you join a domain?
Normally, it is not recommended to disable UAC through Registry and Group Policy. We could reduce UAC functionality through moving the notification bar to Never notify in UAC setting.
If you require a measure to run batch file as administrator, we could create a shortcut by right click the bat file.
Then right click the shot cut\Properties\Shortcut\Advanced\tick “run as administrator”.
After execute this bat file, don't forget to restart your computer.
Best regards,
Joy.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Monday, July 24, 2017 3:36 PM
I agree that it works when I run the command as administrator.
But here, I want the same command to be executed remotely , so how will the command run as administrator remotely ?
Tuesday, July 25, 2017 3:55 AM
Hi Shimith,
According to your description, it seems like you prefer an unattend bat file.
However, when we use command runas /profile /user:username “file path” to execute certain bat file, a promote window will pop-up to require administrator password, but we could not avoid password input. There is no measure to create an unattend bat file.
Did you join domain or workgroup?
If yes, I would recommend you to disable UAC with Group Policy.
UAC level 4:
For more information, please refer to User Account Control Slider and Group Policy Settings.
NOTE: This response contains a reference to a third party Website. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites.
If you have any other concerns, please feel free to tell me directly.
Bests,
Joy.
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].
Tuesday, August 1, 2017 2:47 AM
Hi Shimith,
Was the issue resolved?
Bests,
Please remember to mark the replies as answers if they help.
If you have feedback for TechNet Subscriber Support, contact [email protected].