Launching an EXE in UFT as an Administrator

Hi all.

I’m a fairly new user to UFT having recently upgraded from WR. Hopefully someone can quickly point me in the right direction with this one…

I am attempting to open an exe using SystemUtil.Run, however I need to run the application as an administrator.

The application is set to ‘Always run as Admin’ but when SystemUtil.Run launches the application the User Control Account dialog appears and UFT is not able to see this to click ‘Yes’.

Is anybody able to give me some advice as to what parameters I need to use in SystemUtil, or if there is an alternative way of launching the application from UFT that I should be using?

OS is Win8.1

Many Thanks 

Parents Reply
  • Hello Carl,

     

    Its nice that this solution works for you. I did not have the chance to test it.

     

    Regarding vbs code to add:

    Following (external) article suggests that the corresponding registry value for this setting is

    HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin

    > http://www.techrepublic.com/blog/windows-and-office/temporarily-disable-user-account-control-prompts-in-vista/#.

     

    So you could try following sample vbs code to change it:

    Note: This piece of code is provided out of courtesy and is not supported by HP!

     

    'Disable UAC prompt at the beginning of your script:

    Set oShell = CreateObject("WSCript.shell")
    oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin", "0", "REG_DWORD"

     

     

    'Enable UAC prompt at the end of the script:

    oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin", <original_value>, "REG_DWORD"

    Set oShell = Nothing

     

    You can find more about the WScript object in UFT help.

     

    Regards,

    Ana

Children
No Data