VBA FileCopy hangs with UAC

Posted: 07-11-2008, 10:28 AM
Hi all,

situation:
LAN, with a shared folder on an XP machine. The Vista (Home Premium) user
has full privileges to this shared folder and otherwise has no problems
reading/writing/copying etc. to this folder.

For a particular routine, however, I have VBA code within a Microsoft Access
database which is run on the Vista computer and which uses the FileCopy
command to copy a file from the network shared folder to the Vista user's
root directory (C:\). This operation fails with UAC turned on; it works fine
with UAC turned off.

I'm guessing it's a permissions issue, but don't know how to set it up so
that FileCopy would work even with UAC turned on.

Thanks for any suggestions.
Mark


VBA FileCopy hangs with UAC


Responses to "VBA FileCopy hangs with UAC"

Mr. Arnold
Guest
Posts: n/a
 
Re: VBA FileCopy hangs with UAC
Posted: 07-11-2008, 02:20 PM

"FPS, Romney" <fpswv@citlink.net> wrote in message
news:%236%23xID04IHA.3804@TK2MSFTNGP03.phx.gbl...
> Hi all,
>
> situation:
> LAN, with a shared folder on an XP machine. The Vista (Home Premium) user
> has full privileges to this shared folder and otherwise has no problems
> reading/writing/copying etc. to this folder.
>
> For a particular routine, however, I have VBA code within a Microsoft
> Access
> database which is run on the Vista computer and which uses the FileCopy
> command to copy a file from the network shared folder to the Vista user's
> root directory (C:\). This operation fails with UAC turned on; it works
> fine
> with UAC turned off.
>
> I'm guessing it's a permissions issue, but don't know how to set it up so
> that FileCopy would work even with UAC turned on.
>
> Thanks for any suggestions.
You figure out how to execute this solution using Run As Administrator, from
a short-cut or off the exe Properties, as an example, or somehow you
incorporate into your program solution the usage of the UAC Manifest the
will again present the Run As Administrator credentials to Vista for the
program..

FPS, Romney
Guest
Posts: n/a
 
Re: VBA FileCopy hangs with UAC
Posted: 07-11-2008, 03:50 PM
Thanks for the suggestions, Mr. Arnold
....
Run As Administrator is not listed as an option for either the shortcut, or
the actual file (a Microsoft Access database file). The user logs on with
Administrator privileges. So, I don't know if Microsoft Access database
files have Run As Administrator applied by default, or what. Interestingly,
a shortcut to Windows Explorer does have Run As Administrator listed as an
option.

I didn't understand your second option -- "the usage of the UAC Manifest the
will again present the Run As Administrator credentials to Vista for the
program", but I'm guessing this wouldn't work in this situation anyway. The
database in question undergoes frequent revisions and then is sent out to
users with different operating systems. It would be very cumbersome to have
different code for different operating systems.

"Mr. Arnold" <MR. Arnold@Arnold.com> wrote in message
news:%239QohF24IHA.4272@TK2MSFTNGP03.phx.gbl...
>
> "FPS, Romney" <fpswv@citlink.net> wrote in message
> news:%236%23xID04IHA.3804@TK2MSFTNGP03.phx.gbl...
> > Hi all,
> >
> > situation:
> > LAN, with a shared folder on an XP machine. The Vista (Home Premium)
user
> > has full privileges to this shared folder and otherwise has no problems
> > reading/writing/copying etc. to this folder.
> >
> > For a particular routine, however, I have VBA code within a Microsoft
> > Access
> > database which is run on the Vista computer and which uses the FileCopy
> > command to copy a file from the network shared folder to the Vista
user's
> > root directory (C:\). This operation fails with UAC turned on; it works
> > fine
> > with UAC turned off.
> >
> > I'm guessing it's a permissions issue, but don't know how to set it up
so
> > that FileCopy would work even with UAC turned on.
> >
> > Thanks for any suggestions.
>
> You figure out how to execute this solution using Run As Administrator,
from
> a short-cut or off the exe Properties, as an example, or somehow you
> incorporate into your program solution the usage of the UAC Manifest the
> will again present the Run As Administrator credentials to Vista for the
> program..
>

Mr. Arnold
Guest
Posts: n/a
 
Re: VBA FileCopy hangs with UAC
Posted: 07-12-2008, 07:48 PM

"FPS, Romney" <fpswv@citlink.net> wrote in message
news:ubHnh324IHA.4908@TK2MSFTNGP04.phx.gbl...
> Thanks for the suggestions, Mr. Arnold
> ...
> Run As Administrator is not listed as an option for either the shortcut,
> or
> the actual file (a Microsoft Access database file). The user logs on with
> Administrator privileges. So, I don't know if Microsoft Access database
> files have Run As Administrator applied by default, or what.
> Interestingly,
> a shortcut to Windows Explorer does have Run As Administrator listed as an
> option.
No, the Access database file doesn't have Run as Administrator by default,
as you can see. The MDB file is not an executable.
>
> I didn't understand your second option -- "the usage of the UAC Manifest
> the
> will again present the Run As Administrator credentials to Vista for the
> program", but I'm guessing this wouldn't work in this situation anyway.
> The
> database in question undergoes frequent revisions and then is sent out to
> users with different operating systems. It would be very cumbersome to
> have
> different code for different operating systems.
Well, you can't expect code that runs on the XP platform is going to work on
Vista without change. However, I also would assume the VBA solution is ran
after the user starts Access, which does have a MSaccess.exe that would have
the Run on Administrator on its properties, which only applies to
executables.



>
> "Mr. Arnold" <MR. Arnold@Arnold.com> wrote in message
> news:%239QohF24IHA.4272@TK2MSFTNGP03.phx.gbl...
>>
>> "FPS, Romney" <fpswv@citlink.net> wrote in message
>> news:%236%23xID04IHA.3804@TK2MSFTNGP03.phx.gbl...
>> > Hi all,
>> >
>> > situation:
>> > LAN, with a shared folder on an XP machine. The Vista (Home Premium)
> user
>> > has full privileges to this shared folder and otherwise has no problems
>> > reading/writing/copying etc. to this folder.
>> >
>> > For a particular routine, however, I have VBA code within a Microsoft
>> > Access
>> > database which is run on the Vista computer and which uses the FileCopy
>> > command to copy a file from the network shared folder to the Vista
> user's
>> > root directory (C:\). This operation fails with UAC turned on; it works
>> > fine
>> > with UAC turned off.
>> >
>> > I'm guessing it's a permissions issue, but don't know how to set it up
> so
>> > that FileCopy would work even with UAC turned on.
>> >
>> > Thanks for any suggestions.
>>
>> You figure out how to execute this solution using Run As Administrator,
> from
>> a short-cut or off the exe Properties, as an example, or somehow you
>> incorporate into your program solution the usage of the UAC Manifest the
>> will again present the Run As Administrator credentials to Vista for the
>> program..
>>
>
>
FPS, Romney
Guest
Posts: n/a
 
Re: VBA FileCopy hangs with UAC
Posted: 07-14-2008, 01:39 PM
Thanks for the clarification, Mr. Arnold.
You're correct that the code runs after Access starts. The user is running
with Administrator privileges; Access (MSaccess.exe/Office Pro 2007) opens
fine, and all the other VBA (XP) code runs fine. There's no problem with the
frontend database on the Vista computer importing data/records from an
outside source via VBA code -- it's only on the FileCopy command that it
hangs when it tries to copy a file from the outside source to the local root
directory (C:\).

Using Windows Explorer, I could not manually copy from the outside source to
the local root directory (C:\) with UAC on ... receiving a message that I
did not have sufficient privileges, even though I was logged on with
Administrator rights. I tried increasing those rights to full privileges,
which seemed to happen I guess for most files and folders under the root
directory, but there were certain files and folders that I was informed I
could not have full privileges.

I turned off UAC and had no problem manually copying the file from the
outside source to the local root directory (C:\)

Mark


"Mr. Arnold" <MR. Arnold@Arnold.com> wrote in message
news:%23wTrhhF5IHA.1196@TK2MSFTNGP05.phx.gbl...
>
> "FPS, Romney" <fpswv@citlink.net> wrote in message
> news:ubHnh324IHA.4908@TK2MSFTNGP04.phx.gbl...
> > Thanks for the suggestions, Mr. Arnold
> > ...
> > Run As Administrator is not listed as an option for either the shortcut,
> > or
> > the actual file (a Microsoft Access database file). The user logs on
with
> > Administrator privileges. So, I don't know if Microsoft Access database
> > files have Run As Administrator applied by default, or what.
> > Interestingly,
> > a shortcut to Windows Explorer does have Run As Administrator listed as
an
> > option.
>
> No, the Access database file doesn't have Run as Administrator by default,
> as you can see. The MDB file is not an executable.
>
> >
> > I didn't understand your second option -- "the usage of the UAC Manifest
> > the
> > will again present the Run As Administrator credentials to Vista for the
> > program", but I'm guessing this wouldn't work in this situation anyway.
> > The
> > database in question undergoes frequent revisions and then is sent out
to
> > users with different operating systems. It would be very cumbersome to
> > have
> > different code for different operating systems.
>
> Well, you can't expect code that runs on the XP platform is going to work
on
> Vista without change. However, I also would assume the VBA solution is ran
> after the user starts Access, which does have a MSaccess.exe that would
have
> the Run on Administrator on its properties, which only applies to
> executables.
>
>
>
>
> >
> > "Mr. Arnold" <MR. Arnold@Arnold.com> wrote in message
> > news:%239QohF24IHA.4272@TK2MSFTNGP03.phx.gbl...
> >>
> >> "FPS, Romney" <fpswv@citlink.net> wrote in message
> >> news:%236%23xID04IHA.3804@TK2MSFTNGP03.phx.gbl...
> >> > Hi all,
> >> >
> >> > situation:
> >> > LAN, with a shared folder on an XP machine. The Vista (Home Premium)
> > user
> >> > has full privileges to this shared folder and otherwise has no
problems
> >> > reading/writing/copying etc. to this folder.
> >> >
> >> > For a particular routine, however, I have VBA code within a Microsoft
> >> > Access
> >> > database which is run on the Vista computer and which uses the
FileCopy
> >> > command to copy a file from the network shared folder to the Vista
> > user's
> >> > root directory (C:\). This operation fails with UAC turned on; it
works
> >> > fine
> >> > with UAC turned off.
> >> >
> >> > I'm guessing it's a permissions issue, but don't know how to set it
up
> > so
> >> > that FileCopy would work even with UAC turned on.
> >> >
> >> > Thanks for any suggestions.
> >>
> >> You figure out how to execute this solution using Run As Administrator,
> > from
> >> a short-cut or off the exe Properties, as an example, or somehow you
> >> incorporate into your program solution the usage of the UAC Manifest
the
> >> will again present the Run As Administrator credentials to Vista for
the
> >> program..
> >>
> >
> >
>

Mr. Arnold
Guest
Posts: n/a
 
Re: VBA FileCopy hangs with UAC
Posted: 07-14-2008, 05:51 PM

"FPS, Romney" <fpswv@citlink.net> wrote in message
news:eaXMWdb5IHA.4448@TK2MSFTNGP05.phx.gbl...
> Thanks for the clarification, Mr. Arnold.
> You're correct that the code runs after Access starts. The user is running
> with Administrator privileges; Access (MSaccess.exe/Office Pro 2007) opens
> fine, and all the other VBA (XP) code runs fine. There's no problem with
> the
> frontend database on the Vista computer importing data/records from an
> outside source via VBA code -- it's only on the FileCopy command that it
> hangs when it tries to copy a file from the outside source to the local
> root
> directory (C:\).
>
> Using Windows Explorer, I could not manually copy from the outside source
> to
> the local root directory (C:\) with UAC on ... receiving a message that I
> did not have sufficient privileges, even though I was logged on with
> Administrator rights.
Admin with UAC enabled locks down the Admin user account to Standard user in
most cases where the Admin account must have its privileges escalated.

>I tried increasing those rights to full privileges,
> which seemed to happen I guess for most files and folders under the root
> directory, but there were certain files and folders that I was informed I
> could not have full privileges.
>
> I turned off UAC and had no problem manually copying the file from the
> outside source to the local root directory (C:\)
>
Maybe, it will slove your problem.

<http://www.computerperformance.co.uk/vista/vista_administrator_activate.htm#Summary_of_Vista_ Administrator_-_Super_User_(Hidden_Account)>

FPS, Romney
Guest
Posts: n/a
 
Re: VBA FileCopy hangs with UAC
Posted: 07-14-2008, 07:54 PM
you said:
Admin with UAC enabled locks down the Admin user account to Standard user in
most cases where the Admin account must have its privileges escalated.
.... that might be it. I'll try your link for switching to "super user".
Thanks,
Mark

"Mr. Arnold" <MR. Arnold@Arnold.com> wrote in message
news:uYQ42od5IHA.3768@TK2MSFTNGP02.phx.gbl...
>
> "FPS, Romney" <fpswv@citlink.net> wrote in message
> news:eaXMWdb5IHA.4448@TK2MSFTNGP05.phx.gbl...
> > Thanks for the clarification, Mr. Arnold.
> > You're correct that the code runs after Access starts. The user is
running
> > with Administrator privileges; Access (MSaccess.exe/Office Pro 2007)
opens
> > fine, and all the other VBA (XP) code runs fine. There's no problem with
> > the
> > frontend database on the Vista computer importing data/records from an
> > outside source via VBA code -- it's only on the FileCopy command that it
> > hangs when it tries to copy a file from the outside source to the local
> > root
> > directory (C:\).
> >
> > Using Windows Explorer, I could not manually copy from the outside
source
> > to
> > the local root directory (C:\) with UAC on ... receiving a message that
I
> > did not have sufficient privileges, even though I was logged on with
> > Administrator rights.
>
> Admin with UAC enabled locks down the Admin user account to Standard user
in
> most cases where the Admin account must have its privileges escalated.
>
>
> >I tried increasing those rights to full privileges,
> > which seemed to happen I guess for most files and folders under the root
> > directory, but there were certain files and folders that I was informed
I
> > could not have full privileges.
> >
> > I turned off UAC and had no problem manually copying the file from the
> > outside source to the local root directory (C:\)
> >
>
> Maybe, it will slove your problem.
>
>
<http://www.computerperformance.co.uk...r_activate.htm
#Summary_of_Vista_Administrator_-_Super_User_(Hidden_Account)>
>

 
LinkBack Thread Tools Display Modes
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying filecopy via WMI fail (got security issues) Peter De Mol Windows XP WMI 0 09-14-2006 02:55 PM
Install error: Beginning of the filecopy process (before) Manfire Windows Vista Install & Setup 0 06-12-2006 07:13 PM
extreme slow filecopy FROM (not to) windows 2000 server with XP Pro WS. Robin Hodzelmans Windows XP Network & Web 0 10-23-2003 11:21 AM
Sys hangs Jim Windows XP Hardware 2 09-08-2003 03:15 PM
never hangs up fred Windows XP Network & Web 1 08-21-2003 09:04 PM