Mar 31, 2022 03:05 PM
(This post was last modified: Mar 31, 2022 03:06 PM by arbster90.)
Hi, I'm using a very simple batch script at the moment which adds exclusions to Windows Defender (so requires admin privileges) and a UAC prompt usually pops up e.g. below:
powershell.exe -Command Add-MpPreference -ExclusionPath "C:\"
![[Image: Image_20180403070315180.png]](https://content.spiceworksstatic.com/service.community/p/post_images/0000302380/5ac3628e/attached_image/Image_20180403070315180.png)
Is there anyway to re-run the script instantly until the user clicks yes? E.g. the UAC will keep popping up over and over again if the user clicks no on the UAC until the user clicks Yes and then it goes away?
powershell.exe -Command Add-MpPreference -ExclusionPath "C:\"
![[Image: Image_20180403070315180.png]](https://content.spiceworksstatic.com/service.community/p/post_images/0000302380/5ac3628e/attached_image/Image_20180403070315180.png)
Is there anyway to re-run the script instantly until the user clicks yes? E.g. the UAC will keep popping up over and over again if the user clicks no on the UAC until the user clicks Yes and then it goes away?



![[Image: chain.png]](https://i.postimg.cc/NFnfH9zY/chain.png)