RFF: elevate single procedure

Discussion & Support for xplorer² professional

Moderators: fgagnon, nikos, Site Mods

Post Reply
User avatar
johngalt
Gold Member
Gold Member
Posts: 431
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock
Contact:

RFF: elevate single procedure

Post by johngalt » 2021 Mar 11, 04:12

Hi, Nikos - here comes that RFF.

So, what I envision is that, when, say, trying to delete a protected file or folder that requires elevated privileges, instead of having to run Xplorer² as admin to do so, is there any possibility of getting just a part of the code to elevate for a single procedure?

So, here is the rationale.

I still keep Windows Explorer around because every once in a while, there are files and folders that I can delete with a simple UAC prompt asking for elevated privileges that I cannot do so in Xplorer² - unless I allow it to elevate the entire program, and then have to select the items and do the whole procedure again. It actually takes me less time to "Open Explorer here" and then perform the deletion in Explorer than it does to allow X² to run as admin, select and perform the operation, and then close the new X² instance (not a lot longer, - say maybe a second or two) - but I've been using the workaround through Windows Explorer now for so long that it's rote.

What I'd prefer would be to have X² elevate the delete command only, or else revert to using the native file operations in Windows, which would then include the native UAC prompt for elevated privileges, without having to run a new elevated instance of X² completely. If I could get rid of this one problematic feature of Windows and its protected files like this, then I could use X² as my default FM including replacing with [WinKey] + [E] shortcut. As it is, I still have to keep Windows Explorer on standby for this specific procedure.

So, now that I've written all that down, I suppose the original idea was for a subroutine to get (temporary) elevated privileges to perform that one duty and then revert to regular privileges, but I guessed that you'd say "X² doesn't work that way - to do one thing with elevated privileges you need to elevate the program." So it then sort of morphed into a slightly different RFF, if a file operation is going to require elevated privileges, to drop to using native OS operation calls so that the OS can directly pass elevated privileges for the one operation. if that is even possible?

If you cannot, cool. Just thought I'd ask.
Image

Image

User avatar
nikos
Site Admin
Site Admin
Posts: 15015
Joined: 2002 Feb 07, 15:57
Location: UK
Contact:

Re: RFF: elevate single procedure

Post by nikos » 2021 Mar 11, 06:03

but xplorer2 also can do "partial elevation" just you need to do it the explorer way. So if you want to delete in Program Files, press DEL (not SHIFT+DEL) and you'll see the elevation prompt. That works for rename too. To copy files into protected folders use drag-drop. For more information see here: www.zabkat.com/blog/14Feb10-surviving-UAC.htm

User avatar
johngalt
Gold Member
Gold Member
Posts: 431
Joined: 2008 Feb 10, 19:41
Location: 3rd Rock
Contact:

Re: RFF: elevate single procedure

Post by johngalt » 2021 Mar 11, 16:10

Blast it. I've been using secure delete (aka [SHIFT + DEL]) for a very, very long time. I'm almost obsessive with having the recycle bin empty at all times lol.

Hence it not working for me - I just need to retrain myself to use delete without Shift, eh?

Challenge accepted.
Image

Image

Post Reply