When I create the installer for my application I am going to be creating a folder in their "My Documents", this folder is going to be used to save files from my application into.
I would like to have my application automatically pull up this directory when the save file & open file dialogs open. Now my question is, what is the string I need to use to get to a folder in their "My documents"?
I know to get their my documents directory it goes something like this:
Dim dir as String
dir = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
But how about a folder in their my documents? Such as My Documents/Coolest Application Ever Files. This project is in VB.net.
Thanks in advance.
The Documents folder is the default working folder for all of the files that you create in your Microsoft Office programs. You can choose a different default working folder.
You help your users by remembering where the last file was stored they don’t have to navigate their entire folder structure every time they want to save a file. So far so good.
Please guide us to restrict user to save files to desktop,documents and other folder through group policy. Thanks for your question. 1. Create a Group Policy Object, go to Computer Configuration > Policy > Windows Settings > Security Settings > File System 2.
To access the Documents folder in Windows 10, you can use the following three ways: Way 1: Using File Explorer Click on the Folder looking icon on the Taskbar to open File Explorer. Under Quick access on the left side, there must be a folder with name Documents.
Way 1: Using File Explorer Click on the Folder looking icon on the Taskbar to open File Explorer. Under Quick access on the left side, there must be a folder with name Documents. Click on it, and it will show all the documents you earlier had or have saved recently.
Have a look at Path.Combine
.
dir = Path.Combine(dir, "Coolest Application Ever Files")
Just ensure it exists before your try to write to a file there.
If Not Directory.Exists(dir) Then
Directory.Create(dir)
End If
Dim filepath As String
filepath= IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.MyDocuments, "test.txt")
Well, if you are creating the folder in the "My Documents" folder, can you just assume that you already know the name of said folder? So wouldn't:
dir = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments & "\Your_Folder_Title\")
work?
Just append the folder you're looking for to the MyDocuments special folder
dir = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments & "/Coolest Application Ever Files")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With