To execute the command:
icacls "C:\Program Files\MyDir" /grant myusername:(OI)(CI)(F)
I have not enough rights. Can I make Windows to ask me to get the rights for example via admin account like the images below ? And how ? The script will be executed by WinRar automatically so no manual action must be needed before Windows would prompt for password etc. So I would like to achieve following behaviour:
- Run part of script
- Need rights -> prompt for password etc.
- Got rights, continue with execution
- No rights, break operation
Edit: I found this. And it solved my problem.
Like this:
or this