dbcuser

I have a VS 2005 VC++ code, that calls ShellExecuteEx to launch a program from network. The executed program gets one argument and it is the server location, which get converted to a mapped network drive inside the program and continue with the rest of the program. All is well when it runs as Standard user, also the standard user has the mapped drive to the server location

I have to run this program as an admin user for the first time to do some registration. When the VS 2005 code is launched with 'run as' administrator user (completly diffferent user and current user is standard user), the program from network is lunched but the program will not map the network path to the mapped drive, in other words, the program fails with the message 'Directory or File not found'.

Could someone explain me what is the difference I thought, all the run as does is elevate the privileges of the application to do any admin level tasks but it looks like if the network drive is not mapped in the admin user, the run as will not see the mapped drive. Is it correct or am I doing something wrong

Thanks.




Re: Security for Applications in Windows Vista what is the difference between 'runas' and standard user

AndyCadley

Does the Administrative user account have appropriate access rights on the share





Re: Security for Applications in Windows Vista what is the difference between 'runas' and standard user

dbcuser

My account is the admin. When I run the app all I am doing is run as admin. So I would expect what ever right I have as a standard user should have the same and more access when I run as admin. Isn't that right






Re: Security for Applications in Windows Vista what is the difference between 'runas' and standard user

AndyCadley

Well it depends upon the Share and NTFS permissions on the server. If they grant access to the standard user account but not to your account then it will fail. Being admin on a local box doesn't necessarily grant you unrestricted access to other machines.

Also, if the drive isn't being mapped by the elevated process then it won't be available since you are running under a different context which has it's own independent set of drive mappings.





Re: Security for Applications in Windows Vista what is the difference between 'runas' and standard user

dbcuser

So will the following help resolve the problem

1. Disconnect the mapped network drive.

2. Run explorer as admin

3. Map the network drive (Will it make the network drive available to admin )

4. Now run the application and that should resolve it

Also what do you mean by 'give access to standard user but not to the account ' I checked the permission on the network share and I saw my user id has full permission. Is there something else also has to happen

Thanks for the answer.






Re: Security for Applications in Windows Vista what is the difference between 'runas' and standard user

dbcuser

Finally I found a post where the people had the same problem as mine. Here is what I did to resolve this problem

I have mapped drive to the network share. Now I opened command prompt as admin and used net use and mapped the same drive. This mapping extended the drive map to admin security context. When I ran the program as a regular user and as admin now the program works fine.

Thanks for all the comments and suggestions.