Alaska Software Inc. - Re: Runshell cannot run a program that requires elevation.
Username: Password:
AuthorTopic: Re: Runshell cannot run a program that requires elevation.
Andreas Gehrs-Pahl

View the complete thread for this message in:

Re: Runshell cannot run a program that requires elevation.
on Wed, 21 Oct 2015 16:56:25 -0400
Itai,

>If RunShell() calls a program that requires elevation (usually a popup from 
>the User-Account-Control), the xBase application crashes.  RunShell() should 
>allow the Windows pop-up (do you want to allow this program) to be displayed 
>instead of shutting down the application.
>Can this be fixed?

I haven't ever encountered this kind of problem. It works fine for me with 
all Xbase versions on Windows 7 (the only OS with UAC that I can test on). 
Can you specify what Xbase++ version and OS version you use, and what the 
error message or issue is? What programs do you call? Any example code?

If you try to run an application that needs elevation and you deny the 
program to run -- selecting the [No] button on the pop-up dialog, RunShell() 
will return an OS error -- 1223 "The Operation was canceled by the user" -- 
but you can just [Ignore] that error.

>Is there a work-around this problem?

You can always use the ShellExecuteA function of the OS directly, but that 
won't allow you to run the programs asynchronously (at least not without a 
lot of extra work).

Or you can enclose the RunShell() function within a Sequence and ignore any 
runtime errors that way.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas.GP@Charter.net
web:   http://www.Aerospace-History.net