@echo off
reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "YourAPPPath"
IF errorlevel == 0 (
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "YourAPPPath" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "YourAPPPath" -t REG_SZ /d "~ RUNASADMIN"
) else (
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "YourAPPPath" -t REG_SZ /d "~ RUNASADMIN"
)
把以上代码中的YourAPPPath替换成你自己的程序路径然后保存到批处理(.bat)文件中运行就可以了.