This question already has an answer here:
I am not trying to do cheeky things, but my need is just to have two scripts for adding or removing IP routes using the following command in batch scripts:
@echo off route add -p 220.127.116.11 mask 255.255.255.0 192.168.122.254 exit
@echo off route delete 18.104.22.168 exit
My question is that now I cannot get it run just by double-click on the batch file. I always have to right click and choose:
Run as Administrator option even my user is in the Administrator group.
Is there any way to introduce a command like
sudo in Linux or anything else that can make me happy by just double-clicking on the file.
I tried the
runas solution here but as the answer state:
Note, however, that this is not exactly like sudo - you can't use it to elevate yourself, just run something as a different user. If you're already have administrative rights, a runas to your account will give you the same access as the regular command (unless, of course, you runas a different administrator account, which will grant those administrator's rights to the new shell).
It is not a solution for my problem.