XYCopy 2.0 and UAC
-
- Posts: 25
- Joined: 21 Jun 2009 21:22
- Location: between the lines
- Contact:
XYCopy 2.0 and UAC
Overall I love XYCopy 2.0, but there’s one thing that bugs me. I can’t copy to locations where I don’t have write permissions anymore. Assume I’m logged in as user brotherjohn (a non-admin account) and copy a file from C:\Users\brotherjohn\Desktop (where brotherjohn has write access) to C:\Program Files (where brotherjohn does not have write access).
Old behaviour with OS copy: Usual UAC prompt appears, asks for admin credentials and then continues the operation. XYCopy 2.0 behaviour: The operation immediately aborts with a "Copying Failed. Acces denied" error.
Would it be possible to make XYCopy behave like OS copy? Atm I have to use Win Explorer instead or start a second Xplorer instance with admin priviledges or not use XYCopy 2.0. But none of those is a great solution.
Btw: OS is Win 7 Home Premium 64bit and XYplorer is of course 10.00.
Old behaviour with OS copy: Usual UAC prompt appears, asks for admin credentials and then continues the operation. XYCopy 2.0 behaviour: The operation immediately aborts with a "Copying Failed. Acces denied" error.
Would it be possible to make XYCopy behave like OS copy? Atm I have to use Win Explorer instead or start a second Xplorer instance with admin priviledges or not use XYCopy 2.0. But none of those is a great solution.
Btw: OS is Win 7 Home Premium 64bit and XYplorer is of course 10.00.
cu
Brother John
Brother John
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XYCopy 2.0 and UAC
Difficult. I've spend the better part of the afternoon researching and testing this without success.
It is this dialog I would like to get but cannot:
"You need to confirm this operation."
(Continue Skip Cancel)
At this point I think it is not possible. The CopyFile API is just from another world, whereas UAC is shell. So for these cases you will have to use the normal (shell) copy in XYplorer (hey, no need to run Explorer).
It is this dialog I would like to get but cannot:
"You need to confirm this operation."
(Continue Skip Cancel)
At this point I think it is not possible. The CopyFile API is just from another world, whereas UAC is shell. So for these cases you will have to use the normal (shell) copy in XYplorer (hey, no need to run Explorer).
FAQ | XY News RSS | XY Twitter
Re: XYCopy 2.0 and UAC
A workaround instead of getting the UAC promt could be to use
the RUNAS command and run XYCOPY with that.
http://support.microsoft.com/kb/225035
Another way is to use CreateProcessWithLogonW
http://msdn.microsoft.com/en-us/library ... s.85).aspx
So if the user needs to copy to an area which will fire the UAC promt then
run XYCOPY with CreateProcessWithLogonW
the RUNAS command and run XYCOPY with that.
http://support.microsoft.com/kb/225035
Another way is to use CreateProcessWithLogonW
http://msdn.microsoft.com/en-us/library ... s.85).aspx
So if the user needs to copy to an area which will fire the UAC promt then
run XYCOPY with CreateProcessWithLogonW
Re: XYCopy 2.0 and UAC
Maybe its also possible to get the app (XYCopy) to display the UAC prompt?
A google search on this topic
UAC elevation code
displays some examples...
It seems that a manifest like this and some coding will display the UAC prompt?
A google search on this topic
UAC elevation code
displays some examples...
It seems that a manifest like this and some coding will display the UAC prompt?
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" name="ElevationTest" type="win32"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XYCopy 2.0 and UAC
Thanks, I know the RUNAS trick, but it comes out so clumsy that I decided it's not workable. Also the manifest stuff is just another route to the same results. What I would need is the dialog I mentioned.
FAQ | XY News RSS | XY Twitter
Re: XYCopy 2.0 and UAC
But does not the manifest trick make Windows 7 display the UAC prompt when necessary for the app?admin wrote:Thanks, I know the RUNAS trick, but it comes out so clumsy that I decided it's not workable. Also the manifest stuff is just another route to the same results. What I would need is the dialog I mentioned.
http://www.aneef.net/2009/06/29/request ... aged-code/
This code seems to fire up the UAC prompt when needed...
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XYCopy 2.0 and UAC
Hm, what makes you think so. I don't see a screenshot of the prompt I want. And even if it would work: forcing XYcopy by manifest to run as administrator is not a good solution I think.ugus wrote:But does not the manifest trick make Windows 7 display the UAC prompt when necessary for the app?admin wrote:Thanks, I know the RUNAS trick, but it comes out so clumsy that I decided it's not workable. Also the manifest stuff is just another route to the same results. What I would need is the dialog I mentioned.
http://www.aneef.net/2009/06/29/request ... aged-code/
This code seems to fire up the UAC prompt when needed...
FAQ | XY News RSS | XY Twitter
Re: XYCopy 2.0 and UAC
OK, I thought you wanted this prompt...
"UAC_AccessDenied2.png"
BTW, Dopus fires up this UAC prompt when copying to an UAC protected area.
I think this is the standard Windows behaviour. AFAIK you cannot bypass this prompt
(if you don't disable the Windows UAC control....)
So why is this dialog so bad? It allows you to continue. At the moment XY custom copy fails.
EDIT:
It is only when user has local admin rights you get this prompt anyway? Otherwise you'll have access denied.
"UAC_AccessDenied2.png"
BTW, Dopus fires up this UAC prompt when copying to an UAC protected area.
I think this is the standard Windows behaviour. AFAIK you cannot bypass this prompt
(if you don't disable the Windows UAC control....)
So why is this dialog so bad? It allows you to continue. At the moment XY custom copy fails.
EDIT:
It is only when user has local admin rights you get this prompt anyway? Otherwise you'll have access denied.
-
- Posts: 25
- Joined: 21 Jun 2009 21:22
- Location: between the lines
- Contact:
Re: XYCopy 2.0 and UAC
@Don
Thx for the hint with shell copy. I didn’t think of the shell context menu and its copy functions. That’s a workaround I can live with!
I also agree that UAC_AccessDenied.png needs to appear first because it has all the relevant information to decide if you want to continue or not. That’s usually not the case for UAC_AccessDenied2.png. If that’s not possible I actually prefer the current behaviour. After all copying to read-only locations isn’t something you do that regularly.
@ugus
I know shell copy to work like this: If your user has local admin rights then the two dialogs Don posted appear one after the other. If your user does not have local admin rights it’s the same seqeunce only with the version of UAC_AccessDenied2.png that asks for an admin login.
Thx for the hint with shell copy. I didn’t think of the shell context menu and its copy functions. That’s a workaround I can live with!
I also agree that UAC_AccessDenied.png needs to appear first because it has all the relevant information to decide if you want to continue or not. That’s usually not the case for UAC_AccessDenied2.png. If that’s not possible I actually prefer the current behaviour. After all copying to read-only locations isn’t something you do that regularly.
@ugus
I know shell copy to work like this: If your user has local admin rights then the two dialogs Don posted appear one after the other. If your user does not have local admin rights it’s the same seqeunce only with the version of UAC_AccessDenied2.png that asks for an admin login.
cu
Brother John
Brother John
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XYCopy 2.0 and UAC
It's bad because it is unexpected at this point, because it says "Herausgeber: Unbekannt" (Publisher: Unknown) which is there because I refuse to pay hundreds of dollars just to have my name there, and because of internal technical reasons (it is very hard to get the return codes of this dialog).ugus wrote:OK, I thought you wanted this prompt...
"UAC_AccessDenied2.png"
BTW, Dopus fires up this UAC prompt when copying to an UAC protected area.
I think this is the standard Windows behaviour. AFAIK you cannot bypass this prompt
(if you don't disable the Windows UAC control....)
So why is this dialog so bad? It allows you to continue. At the moment XY custom copy fails.
EDIT:
It is only when user has local admin rights you get this prompt anyway? Otherwise you'll have access denied.
FAQ | XY News RSS | XY Twitter
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XYCopy 2.0 and UAC
Not only shell context menu. All copy operations in XY are using the shell copy UNLESS you opt for the new Custom Copy. If you add the "Use Custom Copy" button to your toolbar you can quickly switch back and forth between shell copy and custom copy.Brother John wrote:@Don
Thx for the hint with shell copy. I didn’t think of the shell context menu and its copy functions. That’s a workaround I can live with!
FAQ | XY News RSS | XY Twitter
Re: XYCopy 2.0 and UAC
OK
Thanks for the info.
Then a reasonable workaround if you want to copy to UAC protected area is to
temporarily toggle the Custom Copy toolbar off
Thanks for the info.
Then a reasonable workaround if you want to copy to UAC protected area is to
temporarily toggle the Custom Copy toolbar off
Re: XYCopy 2.0 and UAC
I wonder whether this can be automated: if set to use Custom Copy but the target requires elevation, automatically pawn only that job off to shell copy?admin wrote:Not only shell context menu. All copy operations in XY are using the shell copy UNLESS you opt for the new Custom Copy. If you add the "Use Custom Copy" button to your toolbar you can quickly switch back and forth between shell copy and custom copy.Brother John wrote:@Don
Thx for the hint with shell copy. I didn’t think of the shell context menu and its copy functions. That’s a workaround I can live with!
It's not a perfect solution, but it would save end users the face palm/RSI-moment of having to dismiss the Custom Copy dialog, switch off Custom Copy and start from scratch, to be followed by re-enabling Custom Copy. I tend to do work in protected areas at least a few times per week, which to me would make such an automated workaround, desirable.
1. It deviates from the expectation set by Windows Explorer but not other FM's: they too need to elevate first.admin wrote:It's bad because it is unexpected at this point, because it says "Herausgeber: Unbekannt" (Publisher: Unknown) which is there because I refuse to pay hundreds of dollars just to have my name there, and because of internal technical reasons (it is very hard to get the return codes of this dialog).
2. The digital certificate stuff is a (well, your... ) business decision. I'm under the impression that both security software as well as browser security mechanisms, have started favouring digitally signed files, but whether that merits your investment?
3. Do you mean the process trying to spawn an elevated process, gets next to no notification of whether consent was granted and the process could thus be run?
-
- Site Admin
- Posts: 60538
- Joined: 22 May 2004 16:48
- Location: Win8.1 @100%, Win10 @100%
- Contact:
Re: XYCopy 2.0 and UAC
The problem: I don't know how to detect whether the target requires elevation.nas8e9 wrote:I wonder whether this can be automated: if set to use Custom Copy but the target requires elevation, automatically pawn only that job off to shell copy?admin wrote:Not only shell context menu. All copy operations in XY are using the shell copy UNLESS you opt for the new Custom Copy. If you add the "Use Custom Copy" button to your toolbar you can quickly switch back and forth between shell copy and custom copy.Brother John wrote:@Don
Thx for the hint with shell copy. I didn’t think of the shell context menu and its copy functions. That’s a workaround I can live with!
It's not a perfect solution, but it would save end users the face palm/RSI-moment of having to dismiss the Custom Copy dialog, switch off Custom Copy and start from scratch, to be followed by re-enabling Custom Copy. I tend to do work in protected areas at least a few times per week, which to me would make such an automated workaround, desirable.
1. It deviates from the expectation set by Windows Explorer but not other FM's: they too need to elevate first.admin wrote:It's bad because it is unexpected at this point, because it says "Herausgeber: Unbekannt" (Publisher: Unknown) which is there because I refuse to pay hundreds of dollars just to have my name there, and because of internal technical reasons (it is very hard to get the return codes of this dialog).
2. The digital certificate stuff is a (well, your... ) business decision. I'm under the impression that both security software as well as browser security mechanisms, have started favouring digitally signed files, but whether that merits your investment?
3. Do you mean the process trying to spawn an elevated process, gets next to no notification of whether consent was granted and the process could thus be run?
3. Yes. At least I don't know how to get this notification. There is next to no documentation on this.
FAQ | XY News RSS | XY Twitter
Re: XYCopy 2.0 and UAC
FWIW, this post on StackOverflow suggests opening the (first) file for writing. If this throws an error, providing it can be handled silently, one could try an alternative action, i.e. Windows Shell copy. One caveat is that UAC virtualisation on Vista and later, makes writing to certain locations silently fail in the sense of redirecting the write, with those locations listed here, meaning those locations would have to be hard-coded exceptions to Custom Copy.admin wrote:The problem: I don't know how to detect whether the target requires elevation.
Regardless of the above test, would it be an idea to hard-code those exceptions in Custom Copy? I'd guess that covers most cases where lack of file permissions cause a problem, although people disabling UAC wouldn't need this of course.