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
2
votes
3 answers

Windows "known folders": is there any one of them which is reliably read/write for all users on all versions?

SHGetKnownFolderPath() and its cohorts accept one of the constants defined here, returning the path to a directory. I'm looking for one of these folders which is reliably writable by all users (including LocalSystem) on XP, Vista, and Windows 7...…
Stabledog
  • 3,110
  • 2
  • 32
  • 43
2
votes
1 answer

Any alternatives to SHGetKnownFolderPath with user token for Windows XP?

My software is still required to support Windows XP. In it I am calling SHGetKnownFolderPath API from the Windows service to obtain user-specific paths (such as FOLDERID_Desktop) by hToken. Since that API is not supported on XP, I'm curious if there…
ahmd0
  • 16,633
  • 33
  • 137
  • 233
1
vote
1 answer

Why was the user font directory not added to the KnownFolder API?

I maintain a library that provides the user-accessible locations for retrieving and storing configuration, cache and other data across multiple platforms. On Windows, this functionality is implemented using the KnownFolder API. Recently I received a…
soc
  • 27,983
  • 20
  • 111
  • 215
1
vote
1 answer

P/Invoke SHSetKnownFolderPath Failing

I thought this would be a simple enough script. I came across this article about how to use powershell to redirect folders to OneDrive here: https://stealthpuppy.com/onedrive-intune-folder-redirection/ I realized this script would not work for me,…
1
vote
1 answer

How do I detect changes to Known Folder Redirection

When OneDrive is installed with Known Folder Move enabled, the first logon of a user starts with no redirection of known folders then midway through the session, they are redirected to the OneDrive folders. How can I detect that? I've already tried…
Mitch
  • 21,223
  • 6
  • 63
  • 86
1
vote
1 answer

How to give permission to create directory with c#

here's my code Directory.CreateDirectory(Directory.GetCurrentDirectory() + @"\ExtractedContent"); using (StreamWriter sw = File.CreateText(Directory.GetCurrentDirectory() + @"\ExtractedContent")) { sw.WriteLine($"TITLE: {extractedTitle[0]}"); …
1
vote
2 answers

absolute path file - is located in special KnownFolders.PicturesLibrary

In my application targeting UWP i want to disable a save ("overwrite") button, if the file (modified in my application) has been opened from location where the application cannot write (in this case "Save As" will only be available). The application…
1
vote
0 answers

Looking up Personal / Documents folder is not showing the right location

My background is more Web Development so this might be an easy question. I have an MS Word Add-In which was originally built to use Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) It has been reported that we should be using the…
Chris Cameron-Mills
  • 4,587
  • 1
  • 27
  • 28
1
vote
1 answer

Using KNOWNFOLDERID or CSIDL in PowerShell

Is there a way to use either KNOWNFOLDERID or CSIDL in PowerShell? I need to be able to access some "known folders" via PowerShell script on a variety of systems. The problem is that those folders' names tend to differ between languages and…
streamofstars
  • 705
  • 1
  • 10
  • 14
0
votes
0 answers

Can I replace %USERPROFILE% and still get KNOWNFOLDERIDs from the registry?

We're developing an open source Python library that runs on Linux, MacOS, and Windows, but we don't have much experience or exposure to Windows in the developer team. The way we setup and run our test suite works fine under Linux and Mac, but is…
adswa
  • 41
  • 5
0
votes
0 answers

Change the paths to user folders(Shell Folders) with Powershell

How to change the paths to user folders (Shell Folders) with Powershell? Required: get the path to the folder $mydoc = [Environment]::GetFolderPath('MyDocuments') C:\Users\shay\Documents Change the drive letters in a variable $mydoc -…
antarey
  • 29
  • 5
0
votes
1 answer

Get Internal Drives Using Windows.Storage Namespace in UWP

Having spent some time reading up on the Windows.Storage classes and methods, I'm a bit shocked to find that there is no simple way to retrieve a list of the internal drives on a machine using UWP. I've found examples such as this: How to get…
0
votes
0 answers

How to change Local Appdata Location

I am trying to create a script that moves some of the windows known folders to other locations/drives, I have succeed moving RoamingAppData but failed on LocalAppData I am using this script to change the location, but it gives me an error when run…
Laikar
  • 333
  • 1
  • 3
  • 9
0
votes
1 answer

How to find second latest ( accessed) file in Windows folder using powershell

I have a folder containing 5 files. I want to skip the first latest file and want the name of second latest file. How I can do this using PowerShell commands?
0
votes
1 answer

KnownFolders that match File Explorer

On the tree view of my File Explorer (formerly Windows Explorer) on Windows 10... I have a number of folders at the root... in my case this includes "Quick access", "DropBox", "OneDrive", "SharePoint", "This PC", and "Network". Is there a…
Brian Rice
  • 3,107
  • 1
  • 35
  • 53