Questions tagged [known-folders]

On Microsoft Windows, Known Folders are constants that represents folders with a special meaning. Examples: Desktop, Program files, Control Panel, Favorites, ... As of Windows Vista, Known Folders replaces the Special Folders (CSIDL) functionality.

MSDN description:
https://msdn.microsoft.com/en-us/library/windows/desktop/bb776911.aspx

44 questions
12
votes
2 answers

C# get location of knownfolder by ID

I want to get the location of a directory/folder by its ID. For example, the Downloads folder has the ID knownfolder:{374DE290-123F-4565-9164-39C4925E467B}, when I enter it into the address bar of windows explorer, it redirects my to the downloads…
Tom Doodler
  • 1,471
  • 2
  • 15
  • 41
10
votes
1 answer

SHGetKnownFolderPath / Environment.GetFolderPath() returning wrong value for public documents

I got a somewhat strange error when trying to resolve the CommonDocuments directory. It keeps resolving to the wrong directory, after the CommonDocuments directory has been redirected / moved to a new location using Windows Explorer…
yas4891
  • 4,774
  • 3
  • 34
  • 55
8
votes
5 answers

SHGetFolderPath Deprecated: What is alternative to retrieve path for Windows folders?

The SHGetFolderPath() function is deprecated beginning with Windows Vista: http://msdn.microsoft.com/en-us/library/bb762181%28v=VS.85%29.aspx What is the alternative way to retrieve the path to the Application Folder in…
user88004
  • 87
  • 1
  • 1
  • 5
8
votes
2 answers

How to get folder path from Known folder GUID in Delphi

I have a KNOWNFOLDERID and I would like to know the corresponding path like C:....\folder. KNOWNFOLDERID can be found here. http://msdn.microsoft.com/en-us/library/bb762584%28VS.85%29.aspx I d like to use win api (I don't want to build an array…
user382591
  • 1,320
  • 5
  • 19
  • 39
7
votes
4 answers

How to enable DocumentsLibrary capability in a Windows store (WinRT) app?

I just created a new blank XAML/C# Windows Store app in Visual Studio. I tried to create a file in the Documents folder with this code: // DEBUG ONLY: StorageFile file = await KnownFolders.DocumentsLibrary.CreateFileAsync("Hey lol.txt"); But it…
6
votes
2 answers

Is there a definitive guide for special folders in windows?

Is there a definitive guide for special folders in windows? An internet search yielded just a few crumbs of information, e.g. Wikipedia:Special Folders Windows 7 Client Software Logo Program What I'm looking for is an explanation of each folder,…
redcalx
  • 8,177
  • 4
  • 56
  • 105
5
votes
2 answers

How to get 64bit system folder in a 32bit application?

In a 32bit application, I have to copy a file to the 64bit system folder (C:\Windows\System32\ instead of C:\Windows\SysWOW64\) For this, I tried to get the folder using the WinAPI function SHGetKnownFolderPath with parameter…
joe
  • 8,344
  • 9
  • 54
  • 80
4
votes
2 answers

Unable to call SHGetKnownFolderPath() even with #include and #pragma comment (lib, "Shell32.lib")

(Visual Studio 2010 / Visual C++ / Windows 7) example.cpp: #include #pragma comment (lib, "Shell32.lib") ... void example() { SHGetKnownFolderPath(...) // undefined } I'm doing everything according to documentation and what I see…
paperduck
  • 1,175
  • 1
  • 16
  • 26
4
votes
4 answers

How can I use powershell to call SHGetKnownFolderPath?

I'm a total noob on windows powershell. How can I use psl to call SHGetKnownFolderPath ? I want to then also call SHSetKnownFolderPath if I dont like some of the values back from Get call.
Alan Jurgensen
  • 813
  • 11
  • 20
3
votes
1 answer

How to get known paths for linux

Windows has a concept of a Known Path with functions to retrieve them without hard-coding a path: #include #include #include //... std::filesystem::path GetAppDataPath() { namespace FS = std::filesystem; …
Casey
  • 10,297
  • 11
  • 59
  • 88
3
votes
4 answers

Programmatically get list of installed application executables (Windows10, C#)

I want to get a list of applications that are installed and executable on Windows 10 -- i.e. executables of applications a user can launch (UWP and non-UWP). For UWP apps, I want to get its AppUserModelId. For non-UWP apps, I want to get the…
Asy
  • 313
  • 1
  • 3
  • 11
3
votes
4 answers

How To Use the SHGetKnownFolderPath Function from Vb6

I am currently adding Windows 7 support to an existing Vb6 project and I have ran into a problem with locating special folder paths using SHGetFolderPath which is not supported on Windows versions starting with Vista. I know I should use…
Gary Kindel
  • 17,071
  • 7
  • 49
  • 66
2
votes
3 answers

Calling SHGetKnownFolderPath from C code

I'm trying to call the Vista function SHGetKnownFolderPath() from C using Visual Studio 2008. The code works fine as C++ but refuses to compile as C code with this output: xyz\indexwiki.cpp(316) : error C2440: 'function' : cannot convert from …
hippietrail
  • 15,848
  • 18
  • 99
  • 158
2
votes
1 answer

Windows Special and Known Folders from python (Start Menu, Downloads, ...)

What is the best method to determine the path of Windows special-folders and known-folders in python? I've uncovered a couple of popular methods for SpecialFolders, a.k.a CSIDL, but nothing straightforward yet for KNOWNFOLDERID. Backwards…
matt wilkie
  • 17,268
  • 24
  • 80
  • 115
2
votes
2 answers

SHGetKnownFolderPath: ambiguous symbol 'IServiceProvider'?

I'm trying to create a folder for my app in /AppData/local so that i can save some ini files in it, i tried to get the Destination path using: #include if (SHGetKnownFolderPath (FOLDERID_LocalAppData, 0, NULL, &tempPath) ==…
razz
  • 9,770
  • 7
  • 50
  • 68
1
2 3