Can't Rename file if administrator permission is required

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Adequat
Posts: 97
Joined: 20 Jul 2007 12:03

Can't Rename file if administrator permission is required

Post by Adequat »

It is not possible to rename a file if administrator permission is required.
For instance, when trying to rename this file:

C:\Program Files (x86)\Test\MyFile.txt

I get this error:
2013-07-30_12-48-44.png
There is not this problem when using Windows Explorer.
Funnily enough, renaming a folder is possible with XYPlorer (eg. C:\Program Files (x86)\Test\)

This is not something new to 12.70. But I think to remember it was possible with some old XYPlorer version.
To see the attached files, you need to log into the forum.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Can't Rename file if administrator permission is require

Post by armsys »

Adequat,
I have no issue narrated by you with XY 12.70.0006.
XY can rename any files in C:\Program Files (x86) and undo it without a glitch.
Have you set XY with ADMIN privilege?

Adequat
Posts: 97
Joined: 20 Jul 2007 12:03

Re: Can't Rename file if administrator permission is require

Post by Adequat »

Of course, if I run XY with administrator privileges, there is no problem.
But Windows Explorer does not run with administrator privileges, yet is able to rename files after the common Windows security confirmation (Message Box). I expect the same from XY.
It is not good (at least for me), to run XY with administrator privileges, as this prevents dragging files from XY to drop them on applications that don't run with administrator privileges (most apps)

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can't Rename file if administrator permission is require

Post by admin »

This is a bug. Fix comes.

grindax

Re: Can't Rename file if administrator permission is require

Post by grindax »

.
Last edited by grindax on 23 Jan 2016 15:32, edited 1 time in total.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can't Rename file if administrator permission is require

Post by admin »

That fails to work mysteriously.

Enternal
Posts: 1175
Joined: 10 Jan 2012 18:26

Re: Can't Rename file if administrator permission is require

Post by Enternal »

Just out of curiosity, how did you fixed the renaming UAC issue?

I probably won't be much of a help but when I was fixing issues with this AutoIt program FolderMenu (posted here in the Software sub-forum), one issue with the program is all UAC related. It seems that if I attempt to do anything in a restricted area of the system directly (like the Program Files directory), I will silently get rejected. However if I instead tell the shell to do whatever I want in my place, the UAC dialog pops up.

Of course I'm not much of a programmer but hopefully there's something there that can help.

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Can't Rename file if administrator permission is require

Post by armsys »

Enternal wrote:Just out of curiosity, how did you fixed the renaming UAC issue?
Hi Enternal,
Have you tried claiming ownership of the whole c:\Program Files (x86)?

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can't Rename file if administrator permission is require

Post by admin »

Enternal wrote:Just out of curiosity, how did you fixed the renaming UAC issue?

I probably won't be much of a help but when I was fixing issues with this AutoIt program FolderMenu (posted here in the Software sub-forum), one issue with the program is all UAC related. It seems that if I attempt to do anything in a restricted area of the system directly (like the Program Files directory), I will silently get rejected. However if I instead tell the shell to do whatever I want in my place, the UAC dialog pops up.

Of course I'm not much of a programmer but hopefully there's something there that can help.
Yes, generally passing the job to the shell is the way. But for unknown reasons SHCreateDirectoryEx (which is shell) does not pop the UAC prompt.

(This thread's particular problem had a more complex reason too long to explain.)

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Can't Rename file if administrator permission is require

Post by armsys »

admin wrote:Yes, generally passing the job to the shell is the way. But for unknown reasons SHCreateDirectoryEx (which is shell) does not pop the UAC prompt.
Perhaps the C:\Program Files (x86) is already owned by "DON"; therefore, SHCreateDirectoryEx remains silent.

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can't Rename file if administrator permission is require

Post by admin »

It's owned by "TrustedInstaller".

armsys
Posts: 557
Joined: 10 Mar 2012 12:40
Location: Hong Kong

Re: Can't Rename file if administrator permission is require

Post by armsys »

Set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\\ConsentPromptBehaviorAdmin to 0

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can't Rename file if administrator permission is require

Post by admin »

Thanks, but it is no solution for me to ask my users to edit a registry key. :|

Filehero
Posts: 2734
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Can't Rename file if administrator permission is require

Post by Filehero »

admin wrote:That fails to work mysteriously.
That mystery was already discussed in here, right?


Cheers,
Filehero

admin
Site Admin
Posts: 67315
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Can't Rename file if administrator permission is require

Post by admin »

Yes, but without success, right?

Post Reply