New
#1
Run User Program As Administrator
I want to create a small program (bat, exe, PowerShell, whatever) to delete all Event logs. I want to put this on the C drive (not a shortcut on the desktop), double-click it, and it runs. I don't want to have to right-click and choose Run as administrator. Approving the UAC prompt is OK. I'm not a programmer, so I have to go with what I see on the Internet.
I have a shortcut on the desktop (again, not what I want), but it does exactly what I want. The code is: C:\Windows\System32\cmd.exe /k for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1".
I also have a bat file created by Brink that I put on the C drive (where I want it) that requires me to click on Run as administrator (again, not what I want). The code is: for /F "tokens=*" %%a in ('wevtutil.exe el') DO wevtutil.exe cl "%%a". Plus, I put a PAUSE in there at the end.
I've tried various methods I've seen to try to get something to run automatically as administrator, but nothing has worked. I also tried IExpress, but that didn't work.
Why is this so complicated, and why does something have to be a shortcut to have the Run as administrator checkbox?
Can anybody make this happen? Is it even possible? Thanks.
(And please, no lectures about the advisability of deleting the Event logs. Thanks.)