To execute a command using this method, enter one of the following values:
RUNAS /NOPROFILE /USER:computername/username "IPCONFIG /FLUSHDNS" RUNAS /PROFILE /ENV /USER:domain/username "IPCONFIG /FLUSHDNS" RUNAS /ENV /USER:username@domain "IPCONFIG /FLUSHDNS"
Replace "computer_name", "username" and / or "domain" with the corresponding information. The problem with these methods is that they require an administrator password, which I could not figure out on my machine. However, if it is something like linux, it is a random hash hidden by the system. Another way you can try:
32-bit:
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "%HOMEDRIVE%\WINDOWS\System32\ipconfig.exe" /D RUNASADMIN
64-bit:
REG ADD "HKLM\SOFTWARE\WOW6432\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "%HOMEDRIVE%\WINDOWS\System32\ipconfig.exe" /D RUNASADMIN
This method will add the program to the registry so that it starts with administrator rights every time it starts (compatibility mode). This method only works until your directory changes. You must specify the direct path to the program in your registry. You could have a script look something like this:
@ECHO OFF CD \ REG ADD "HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /V "%HOMEDRIVE%\WINDOWS\System32\ipconfig.exe" /D RUNASADMIN IPCONFIG /FLUSHDNS PAUSE>NUL
Hope this helps you. You can check Verboon for more information on this REG ADD command and compatibility mode.
toddimyre
source share