79579333

Date: 2025-04-17 13:22:38
Score: 1
Natty:
Report link

Here's another thing to consider: On Windows 11, the default "Documents" folder MAY be a cloud folder, such as OneDrive. If you are writing data to the user's Documents folder, some file types, such as a standalone database (Access or SQLite) will stall or fail during the "write" period because the service is trying to sync the database into the cloud, causing not only a severe performance hit, but can also corrupt the database.

Windows 11 has an option for users to re-direct the "Documents" folder to the non-cloud location (C:\Users\<name>\Documents\), but it's not the default. If you are using the Documents folder and/or subfolder for such files, the alternative is this:

Dim docFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & "\Documents\"

That will deliver the path to the C:\Users\<name>\Documents\ folder. And of course, you should test whether it exists, create it if it doesn't and test that you can write to it.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Phase25 Support