Re: VC++ 6.0 dll can not access a network drive
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Fri, 28 Sep 2007 17:42:52 -0400
I believe that the use of the runas verb is possibly different than what you have
previously described, which would be to launch the program in Vista using the "run as
administrator" option. If you do the 'runas' you probably specify the account name to run
it as, and that means you are running as a completely different user, and whatever you
have done to map drives has absolutely nothing to do with whatever context (mapped drives,
environment, etc.) that the initiating program is running in.
Why didn't you explain this in your first message?
joe
On Fri, 28 Sep 2007 13:48:23 -0700, DBC User <dbcuser@xxxxxxxxx> wrote:
On Sep 27, 4:07 pm, "David Ching" <d...@xxxxxxxxxxxxxxxxxxxxxx> wrote:Joseph M. Newcomer [MVP]
"DBC User" <dbcu...@xxxxxxxxx> wrote in message
news:1190916541.644071.258420@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sorry it took some time. After some more research this is what I
found, may be you would able to help me now. Let me restate the
problem. My user is is a member of administartive group. I mapped a
network drive. Now I run my program and it works perfectly fine. It
executes the program in the network and everything is fine.
Now I 'run as' administator on the same program and the program can
not see the network drive. When you run the program as administator I
thought it runs in elevated mode. Is it still true with integrity
level?
For me it looks like when you run as admin, it is running in a
complete profile and in that profile there is no mapped network. Is it
a safe assumption? If so how can we resolve it?
Thanks.,
Thanks.- Hide quoted text -
- Show quoted text -
So to confirm my finding, I logged in as an admin and mapped the same
drive and now when I do 'run as' my program works like a charm.
Thanks.
Running on the Administrator account is *not* the same as doing the "Run As
Administrator" from a different account. The wording implies they are the
same, but they're not. The Admninistrator account (when you "logged in as
Admin") is a user account with a username/password, and it it these
credentials that might give you access to the network drive. But "Run As
Administrator" ("elevates" the process) merely gives the app access to
resources with a High MIC level. Since, AFAIK, network drives aren't
associated with MIC level --- only by the user authentication
(username/password) --- this should not alter the behavior at all.
Only if the non-Admin account has access to the network drive (can you map
it in Explorer, for example?) will you be able to access it from your app,
whether you Run As Administrator or not.
-- David
David,
Now that I read the last part of your question 'correctly', Yes, when
I run the program without 'runas', it is seeing the mapped drive. But
when I run it as 'runas', it is not seeing the network drive at all.
Also I conveniently missed some of the more detail of the process.
Here it goes, hopefully this will clear some of the questions you
might have. I have a program A which has a manifest to run it as
"highestAvailable". This program at the end launches program B with
ShellExecuteEx with 'runas' verb. Also one more thing in this puzzle
is, A is in local drive c:\program and program B is in mapped network
drive. When the program B runs as 'runas', when program B it try to
access the network drive, it gets 'Directory/File not found'. So the
problem is not with Program A, it is the called program B, which can
not see the network drive.
Hopefully I answered your question properly.
Thanks.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Re: VC++ 6.0 dll can not access a network drive
- From: DBC User
- Re: VC++ 6.0 dll can not access a network drive
- From: Joseph M . Newcomer
- Re: VC++ 6.0 dll can not access a network drive
- From: David Ching
- Re: VC++ 6.0 dll can not access a network drive
- From: Joseph M . Newcomer
- Re: VC++ 6.0 dll can not access a network drive
- From: David Ching
- Re: VC++ 6.0 dll can not access a network drive
- From: DBC User
- Re: VC++ 6.0 dll can not access a network drive
- From: DBC User
- Re: VC++ 6.0 dll can not access a network drive
- From: David Ching
- Re: VC++ 6.0 dll can not access a network drive
- From: DBC User
- Re: VC++ 6.0 dll can not access a network drive
- Prev by Date: Re: VC++ 6.0 dll can not access a network drive
- Next by Date: Re: horizontally pushing out old window with new
- Previous by thread: Re: VC++ 6.0 dll can not access a network drive
- Next by thread: Re: VC++ 6.0 dll can not access a network drive
- Index(es):
Relevant Pages
|