Back some time ago, Mark Miesfeld had this dialog with me on a
similar issue I was pursuing:
 
On Sat, Apr 5, 2014 at 2:15 PM, Art Heimsoth <[email protected]> wrote:
Is there something that will allow the current process level to be
tested, and elevated if required from ooRexx or ooDialog?  
 
This is not as easy as it would seem.
 
Typically what you have to do is start a new process with the elevated status.  I've done that in the oodialog.exe that is available in ooDialog 4.2.3.  The testing of the current process for the required access is done and I can make that part available through ooDialog.
 
The starting of the a new process is not so easy.  Probably would need to start a new version of the interpreter to carry out the command.  This is doable I think, and I've toyed with the idea of implementing it in ooDialog, but haven't worked on finishing it up.
 
You can get an idea of how it works by running:
 
oodialog
 
Then on the dialog that comes up, check the "Configure other ooDialog services" check box at the the bottom left of the dialog.  Once that is checked, click the "Continue" button on the bottom right.  This will bring up another dialog.
 
In that dialog, check the "For all users" radio button.  Now, providing you are not already running as Administrator", you will see that the "Configure" button has the 'needs admin privilege" logo on it.  When you click on the button, you will get the prompt to allow Admin privileges.  If you do allow Admin privileges, the dialog is restarted with elevated privileges.
 
So, up to there is already code and tested, except for the restarting part.  The restarting part is currently code in C++ for the specific purpose of the dialog.  
 
What I'm thinking is, that at that point a new interpreter could be started, with elevated privileges.  There are a number of options here.  You could pass the new interpreter a script to run, you could just let the interpreter run, you could ...?
 
So, there is nothing to do it yet, but it is probably possible to do.
 
  Art
 
> I'm no expert, but I don't know of one. I do know that there are
> times in W7 that I have to 'Run as Admin', even though I have Admin
> rights. Don't do enough of such stuff to remember the occasion.
>
> Les
>
> On 9/16/2014 1:27 PM, Staffan Tylen wrote:
>> Rick, many thanks for this helpful information.
>>
>> Les, I'm on Windows 7 and wish to control (in a rexx program) if
>> the current user has admin authorities before I start fiddling
>> with things that only such users can do. Of course I could
>> attempt something and if it fails assume the user is not an
>> admin, but I'm more looking for a standard isAdmin() function or
>> similar.
>>
>> Staffan
>>
 
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to