VB.NET Permission to access local user's folders - vb.net

In my VB.NET app, an AD user(timmy) can login and access his exchange a/c through Outlook. Outlook is launched using a Process.
When user tries to double click an attachment of PDF file, Edge being and to-be the default PDF viewer opens up but fails to load the file. It shows error message :
The reason I can think of is: user timmy doesn't have access to user cbembinster's local files.
How can I give access to timmy to access local user's files and folders ?
Can anyone give any idea on how to solve this problem. Any help is highly appreciated.
Thanks

Related

VBA macro, unable to access file on OneDriveFB when not in the office

My VBA macro has this line of code:
Workbooks.Open FileName:="https://<MyOneDriveForBusinessFolder>/<MyFileName.xlsm>"
The whole macro works fine for users in the company office, but fails on the above line for users logging to corporate network from remote locations.
The folder is shared with entire security group, all users have "Can View" access level.
All users, including those for whom the code fails, are able to access the folder/file via browser.
Not sure if this is of any importance, but as this is OneDrive for Business, I believe the file is encrypted.
Can anyone advise please, why this is happening?
Your corporate OneDrive instance is location restricted. There's nothing Excel can do to overcome that. It's a security feature.

While opening file upload dialogue from website, "Folder not accessible, Access denied" error message comes

I am trying to upload files to my website.
Every time when upload dialog opens, it tries to open a default path "C:\Windows\system32\config\systemprofile".
This path is not accessible by every user on all the machines except Admin user.
I even tried to set this default path to "My Documents" but i am not able to get this path runtime.
Thanks in advance !
Don't use the My Documents folder, try using Default User's Documents folder instead.
Also check here for more information:
Exceptions in Yesod

Error Access denied to programmatically created folder

I Have Created document set in that document i have programmatically created an Tempfolder but when i access that folder it shows error like"Access to the path 'C:\Users\Administrator\AppData\Local\Temp\MyTempFolder' Access is denied"
please guide me.
It is correct behavior because you need administrator's rights to access that folder.
The simples solution is to run you program as Administration but I would rather change the folder, otherwise you need to elevate the rights of you app.
Furhter you can look here and here.

Application/User Settings with Roaming Profiles

Hi Guys any help would be much appreciated.
We have an application that’s installed at several locations but we are having an issue at one particular site. In short the application settings (My.) are not being saved after a reboot. The application is build in VB.Net v3.5 Framework and we are not experiencing any issues elsewhere.
This particular site is using roaming profiles and the network administrator ensures us that the correct permissions are applied to the user account(s) and all application data is being saved to the server. I’ve asked the network admin to check for the existence of the user settings file user.config in the Application Data directory and he says it doesn’t exist.
In our application we store the connection string to the database in the application settings under the user scope. If no connection string is present or if one is present and a connection to the database cannot be made then a form is shown asking the user for the database credentials. Each morning when the users boot the machine and opens the application for the first time they are asked for these credentials but if they close the application and restart it they are not asked for them. This indicates to us that the settings are being saved but once the pc is rebooted and the application is opened for the first time they are asked for the database credentials. This seems like the settings are not persisting after a reboot.
Any thoughts/feedback would be much appreciated.
I'm wondering if it's Code Access Security preventing the file from being written?
If the sysadmin at trouble site has implemented group policy folder redirection, the user's local/roaming profile could be getting stored on a network fileshare. Code Access Security is fairly picky about letting code read/write to/from network resources.
I'm sorry that I don't have more details than this, and I didn't find any sure-fire hits on google, but searching for "code access security", "fulltrust" and any network/fileshare keywords you can think of may get you farther.

Why does accessing files in AppData (on Vista) require admin rights?

My application (vb.net) sometimes throws an "access denied" exception when attempting to delete files in the AppData folder and I'm not sure why.
I confirm that the file exists before attempting to delete it and have not done anything to make it readonly, etc.
The interesting thing is that it seems to go okay when I'm logged in with Admin rights. However, I thought that the AppData folder did not require admin rights.
Any help would be greatly appreciated!
Thanks!
My gut instincts without seeing your code is that maybe you have this file opened in your program or in another program?
Maybe these files were created when you launched your application being logged on as Admin? So you get this error when you try to delete them later as normal user.
It is not necessarily the folder, but the Owner of the file you are trying to interact with. If the File is owned by Administrators, you may have problems.
AppData is a protected hidden folder because it is meant for your applications to store Local, LocalLow and Roaming application related data. This is why you would get prompted with a UAC prompt when you try to head into the folder and it is also hidden from view.
Try to use the Privilege demand attribute in your code to request process elevation to access the folder.