Re: VC++ 6.0 dll can not access a network drive



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:
"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.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: I hate disgruntled employees!
    ... since I dont have admin access then I can which means Email, ... network drives are out of the question and the IT guy is ... You can try logging on with the built-in Administrator account ... Here's how to logon as Administrator in XP Pro. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: VC++ 6.0 dll can not access a network drive
    ... Administrator" from a different account. ... Since, AFAIK, network drives aren't ... I run the program without 'runas', it is seeing the mapped drive. ...
    (microsoft.public.vc.mfc)
  • Re: VC++ 6.0 dll can not access a network drive
    ... Running on the Administrator account is *not* the same as doing the "Run As ... resources with a High MIC level. ... Since, AFAIK, network drives aren't ...
    (microsoft.public.vc.mfc)
  • Re: Administrator logon
    ... Desktop [right click application shortcut and select runas] and then you ... enter credentials for the administrator account. ... > and one limited access account. ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Why cant I remote-manage this *one* workstation?
    ... It could be an account issue (e.g. local worksation admin messing with logon ... The RUNAS trick will help you narrow down a possible account issue. ... > logged in as the domain administrator account. ...
    (microsoft.public.windows.group_policy)

Loading