I have encountered this issue. You maybe know the free utility AutoIT for
runas an executable with different credentials.
When i'm logged into xp desktop with an account that has admin rights and manually launch the Autoit
executable that executes the following AutoIT script
;~ If Windows Vista/7 will prompt with UAC
;~ User Variables
$USR_USERNAME = 'Administrator'
$USR_PASSWORD = 'Password'
;~ Package Variable
$PKG_FILENAME = @TempDir & '\Package.exe'
;~ Note: Package.exe should be in the same location as the .au3 Script when compiling
;~ This Packs Package.exe into the Script Executable
;~ When the Script Executable is run it unpacks Package.exe to %Temp%\Package.exe
;~ This runs the executable using the User Variables above
;~ Change /SilentSwitches with your own
RunAsWait($USR_USERNAME, @ComputerName, $USR_PASSWORD, 0, $PKG_FILENAME & ' /silentswitches', '', @SW_HIDE)
;~ After the script has completed, delete %Temp%\Package.exe
The installation works fine.
When I try to launch the compiled .exe then (it is supposed to pass the local administrator credentials) it prompts for user/password with rights to proceed with the installation.
I believe the #RequireAdmin directive is what's causing the prompt and is functioning as designed. Take a look at the AutoIt help topic "AutoIt on Windows Vista". It will explain how the #RequireAdmin directive behaves under different versions of the Windows OS.
Here's an exerpt:
When the script runs AutoIt will check if it already has full admin rights and if not it will cause the operating system to prompt the user for permission as shown in "UAC Prompts". If permission is not given by the user the script will terminate.